">
- <%= checked_image(type.enabled_in?(@project.project_type)) %>
+ <%= checked_image(type.enabled_in?(@project)) %>
|
<%= check_box_tag "project[planning_element_type_ids][]",
diff --git a/features/planning_elements/planning_element_management.feature b/features/planning_elements/planning_element_management.feature
index 0fe8694ac8..710f24261a 100644
--- a/features/planning_elements/planning_element_management.feature
+++ b/features/planning_elements/planning_element_management.feature
@@ -15,20 +15,16 @@ Feature: Planning Element Management
So that I can plan the project's progress and report it to other projects
Background:
- Given there are the following planning element types:
- | Name | Is Milestone | In aggregation |
- | Phase | false | true |
- | Milestone | true | true |
+ Given there are the following types:
+ | Name | Is milestone | In aggregation | Is default |
+ | Phase | false | true | true |
+ | Milestone | true | true | true |
And there are the following project types:
| Name |
| Standard Project |
| Extraordinary Project |
- And the following types are default for projects of type "Standard Project"
- | Phase |
- | Milestone |
-
And there is 1 user with:
| login | manager |
diff --git a/features/planning_elements/planning_element_textile_link.feature b/features/planning_elements/planning_element_textile_link.feature
index da21a96b59..aa541795ea 100644
--- a/features/planning_elements/planning_element_textile_link.feature
+++ b/features/planning_elements/planning_element_textile_link.feature
@@ -11,20 +11,16 @@
Feature: Planning elements textile quickinfo links
Background:
- Given there are the following planning element types:
- | Name | Is Milestone | In aggregation |
- | Phase | false | true |
- | Milestone | true | true |
+ Given there are the following types:
+ | Name | Is Milestone | In aggregation | Is default |
+ | Phase | false | true | true |
+ | Milestone | true | true | true |
And there are the following project types:
| Name |
| Standard Project |
| Extraordinary Project |
- And the following types are default for projects of type "Standard Project"
- | Phase |
- | Milestone |
-
And there is 1 user with:
| login | manager |
diff --git a/features/planning_elements/show.feature b/features/planning_elements/show.feature
index 5593bf5d12..d90e91388c 100644
--- a/features/planning_elements/show.feature
+++ b/features/planning_elements/show.feature
@@ -12,17 +12,14 @@
Feature: Viewing a planning_element
Background:
- Given there are the following planning element types:
- | Name | Is Milestone | In aggregation |
- | Phase | false | true |
+ Given there are the following types:
+ | Name | Is Milestone | In aggregation | Is default |
+ | Phase | false | true | true |
And there are the following project types:
| Name |
| Standard Project |
- And the following types are default for projects of type "Standard Project"
- | Phase |
-
And there is 1 user with:
| login | manager |
diff --git a/features/project_types/project_creation_with_type.feature b/features/project_types/project_creation_with_type.feature
index e369ebb0fc..e53788219e 100644
--- a/features/project_types/project_creation_with_type.feature
+++ b/features/project_types/project_creation_with_type.feature
@@ -15,25 +15,17 @@ Feature: Project creation with support for project type
So that the default planning element types are enabled automatically
Background:
- Given there are the following planning element types:
- | Name |
- | Phase |
- | Milestone |
- | Something else |
+ Given there are the following types:
+ | Name | Is default |
+ | Phase | true |
+ | Milestone | false |
+ | Something else | false |
And there are the following project types:
| Name |
| Standard Project |
| Extraordinary Project |
- And the following types are default for projects of type "Standard Project"
- | Phase |
- | Milestone |
-
- And the following types are default for projects of type "Extraordinary Project"
- | Something else |
-
-
Scenario: The admin may create a project with a project type
Given I am logged in as "admin"
When I go to the admin page
@@ -47,42 +39,10 @@ Feature: Project creation with support for project type
Then I should see a notice flash stating "Successful creation."
- When I go to the settings/timelines page of the project called "Fancy Pants"
- Then the "Phase" checkbox should be checked
- And the "Milestone" checkbox should be checked
- And the "Phase" row should be marked as default
- And the "Milestone" row should be marked as default
-
- Scenario: The project admin may change the project type, planning element types remain unchanged
- Given there is 1 user with:
- | login | padme |
-
- And there is a role "project admin"
- And the role "project admin" may have the following rights:
- | edit_project |
- | manage_project_configuration |
-
- And there is a project named "Fancy Pants" of type "Standard Project"
- And I am working in project "Fancy Pants"
-
- And the project uses the following modules:
- | timelines |
-
- And the user "padme" is a "project admin"
-
- And I am logged in as "padme"
-
- When I go to the settings page of the project called "Fancy Pants"
- And I select "Extraordinary Project" from "Project type"
- And I press "Save" within "#tab-content-info"
-
- Then I should see a notice flash stating "Successful update."
+ When the following types are enabled for projects of type "Standard Project"
+ | Phase |
+ | Milestone |
+ And I go to the settings page of the project called "Fancy Pants"
- When I go to the settings/timelines page of the project called "Fancy Pants"
Then the "Phase" checkbox should be checked
And the "Milestone" checkbox should be checked
- And the "Something else" checkbox should not be checked
-
- And the "Phase" row should not be marked as default
- And the "Milestone" row should not be marked as default
- And the "Something else" row should be marked as default
diff --git a/features/step_definitions/timelines_given_steps.rb b/features/step_definitions/timelines_given_steps.rb
index 1e523c220b..ce4425fb08 100644
--- a/features/step_definitions/timelines_given_steps.rb
+++ b/features/step_definitions/timelines_given_steps.rb
@@ -91,17 +91,11 @@ Given /^I delete the scenario "([^"]*)"$/ do |scenario_name|
scenario.destroy
end
-Given /^there is a project named "(.*?)"$/ do |name|
- FactoryGirl.create(:project, :name => name)
-end
-
-# Using our own project creation step to make sure, that we may initially assign
-# a project type.
-#
-Given /^there is a project named "([^"]*)" of type "([^"]*)"$/ do |name, project_type_name|
+Given /^there is a project named "([^"]*)"(?: of type "([^"]*)")?$/ do |name, project_type_name|
+ project_type_id = ProjectType.find_by_name!(project_type_name).id unless project_type_name.nil?
FactoryGirl.create(:project,
:name => name,
- :project_type_id => ProjectType.find_by_name!(project_type_name).id)
+ :project_type_id => project_type_id)
end
Given /^there are the following projects of type "([^"]*)":$/ do |project_type_name, table|
@@ -144,3 +138,15 @@ Given /^there is a timeline "([^"]*)" for project "([^"]*)"$/ do |timeline_name,
timeline.save!
end
+Given /^the following types are enabled for projects of type "(.*?)"$/ do |project_type_name, type_name_table|
+ project_type = ProjectType.find_by_name(project_type_name)
+ projects = Project.where(:project_type_id => project_type.id)
+ types = type_name_table.raw.flatten.map do |type_name|
+ Type.find_by_name(type_name) || Factory.create(:type, :name => type_name)
+ end
+
+ projects.each do |project|
+ project.types = types
+ project.save
+ end
+end
diff --git a/features/timelines/timeline_view.feature b/features/timelines/timeline_view.feature
index 0dc8a266ce..360eb514a2 100644
--- a/features/timelines/timeline_view.feature
+++ b/features/timelines/timeline_view.feature
@@ -16,7 +16,7 @@ Feature: Timeline View Tests
edit planning elements via a modal window
Background:
- Given there are the following planning element types:
+ Given there are the following types:
| Name | Is Milestone | In aggregation |
| Phase | false | true |
| Milestone | true | true |
@@ -26,26 +26,26 @@ Feature: Timeline View Tests
| Standard Project |
| Extraordinary Project |
- And the following types are default for projects of type "Standard Project"
- | Phase |
- | Milestone |
-
And there is 1 user with:
| login | manager |
And there is a role "manager"
And the role "manager" may have the following rights:
- | view_timelines |
- | edit_timelines |
- | view_planning_elements |
- | move_planning_elements_to_trash |
- | delete_planning_elements |
- | edit_planning_elements |
- | delete_planning_elements |
+ | view_timelines |
+ | edit_timelines |
+ | view_planning_elements |
+ | move_planning_elements_to_trash |
+ | delete_planning_elements |
+ | edit_planning_elements |
+ | delete_planning_elements |
And there is a project named "ecookbook" of type "Standard Project"
And I am working in project "ecookbook"
+ And the following types are enabled for projects of type "Standard Project"
+ | Phase |
+ | Milestone |
+
And the project uses the following modules:
| timelines |
@@ -54,22 +54,22 @@ Feature: Timeline View Tests
And I am logged in as "manager"
And there are the following planning elements:
- | Subject | Start date | Due date | description | status_name | responsible |
- | January | 2012-01-01 | 2012-01-31 | Aioli Grande | closed | manager |
- | February | 2012-02-01 | 2012-02-24 | Aioli Sali | closed | manager |
- | March | 2012-03-01 | 2012-03-30 | Sali Grande | closed | manager |
- | April | 2012-04-01 | 2012-04-30 | Aioli Sali Grande | closed | manager |
- | IchBinEinSoLangesPlannungselementIchMacheAllehierkRanKundDaNnaUcHnOcHdieseGroßUNDKleinSchReiBungWieklEiNeKinDer | 2012-04-01 | 2012-04-30 | Devilish | closed | manager |
+ | Start date | Due date | description | status_name | responsible | Subject |
+ | 2012-01-01 | 2012-01-31 | Avocado Hall | closed | manager | January |
+ | 2012-02-01 | 2012-02-24 | Avocado Rincon | closed | manager | February |
+ | 2012-03-01 | 2012-03-30 | Hass | closed | manager | March |
+ | 2012-04-01 | 2012-04-30 | Avocado Choquette | closed | manager | April |
+ | 2012-04-01 | 2012-04-30 | Devilish | closed | manager | Loremipsumdolorsitamet,consecteturadipisicingelit,seddoeiusmodtemporincididuntutlaboreetdoloremagnaaliqua.Utenimadminimveniam |
Scenario: The project manager gets 'No data to display' when there are no planning elements defined
When I go to the page of the project called "ecookbook"
And I toggle the "Timelines" submenu
And I follow "Timeline reports"
Then I should see "New timeline report"
- And I should see "General Settings"
+ And I should see "General Settings"
Scenario: create a timeline
- When there is a timeline "Testline" for project "ecookbook"
+ When there is a timeline "Testline" for project "ecookbook"
And I go to the page of the project called "ecookbook"
And I toggle the "Timelines" submenu
And I follow "Timeline reports"
@@ -79,20 +79,20 @@ Feature: Timeline View Tests
@javascript
Scenario: planning element click should show modal window
- When there is a timeline "Testline" for project "ecookbook"
+ When there is a timeline "Testline" for project "ecookbook"
And I go to the page of the timeline "Testline" of the project called "ecookbook"
And I wait for timeline to load table
And I click on the Planning Element with name "January"
Then I should see the planning element edit modal
And I should see "January (*1)"
- And I should see "Aioli Grande"
+ And I should see "Avocado Hall"
And I should see "01/01/2012 - 01/31/2012"
And I should see "New timeline report"
And I should be on the page of the timeline "Testline" of the project called "ecookbook"
@javascript
Scenario: edit should open edit
- When there is a timeline "Testline" for project "ecookbook"
+ When there is a timeline "Testline" for project "ecookbook"
And I go to the page of the timeline "Testline" of the project called "ecookbook"
And I wait for timeline to load table
And I click on the Planning Element with name "January"
@@ -104,7 +104,7 @@ Feature: Timeline View Tests
@javascript
Scenario: edit in modal
- When there is a timeline "Testline" for project "ecookbook"
+ When there is a timeline "Testline" for project "ecookbook"
And I go to the page of the timeline "Testline" of the project called "ecookbook"
And I wait for timeline to load table
And I click on the Planning Element with name "January"
@@ -117,7 +117,7 @@ Feature: Timeline View Tests
@javascript
Scenario: enter wrong date in modal
- When there is a timeline "Testline" for project "ecookbook"
+ When there is a timeline "Testline" for project "ecookbook"
And I go to the page of the timeline "Testline" of the project called "ecookbook"
And I wait for timeline to load table
And I click on the Planning Element with name "January"
@@ -130,7 +130,7 @@ Feature: Timeline View Tests
@javascript
Scenario: trash element
- When there is a timeline "Testline" for project "ecookbook"
+ When there is a timeline "Testline" for project "ecookbook"
And I go to the page of the timeline "Testline" of the project called "ecookbook"
And I wait for timeline to load table
And I trash the planning element with name "January"
@@ -161,7 +161,7 @@ Feature: Timeline View Tests
@javascript
Scenario: trash vertical should be removed
- When there is a timeline "Testline" for project "ecookbook"
+ When there is a timeline "Testline" for project "ecookbook"
And I make the planning element "January" vertical for the timeline "Testline" of the project called "ecookbook"
And I go to the page of the timeline "Testline" of the project called "ecookbook"
diff --git a/features/timelines/timeline_view_with_reporters.feature b/features/timelines/timeline_view_with_reporters.feature
index 847031ac8d..97fe6bc33e 100644
--- a/features/timelines/timeline_view_with_reporters.feature
+++ b/features/timelines/timeline_view_with_reporters.feature
@@ -28,20 +28,6 @@ Feature: Timeline View Tests with reporters
| Standard Project |
| Extraordinary Project |
- And the following types are default for projects of type "Standard Project"
- | Phase1 |
- | Phase2 |
- | Phase3 |
- | Phase4 |
- | Milestone |
-
- And the following types are default for projects of type "Extraordinary Project"
- | Phase1 |
- | Phase2 |
- | Phase3 |
- | Phase4 |
- | Milestone |
-
And there is 1 user with:
| login | manager |
@@ -58,6 +44,7 @@ Feature: Timeline View Tests with reporters
| view_project_associations |
And there is a project named "ürm" of type "Standard Project"
+
And I am working in project "ürm"
And the user "manager" is a "manager"
@@ -70,6 +57,13 @@ Feature: Timeline View Tests with reporters
And I am working in project "ecookbook0"
And the user "manager" is a "manager"
+ And the following types are enabled for projects of type "Standard Project"
+ | Phase1 |
+ | Phase2 |
+ | Phase3 |
+ | Phase4 |
+ | Milestone |
+
And the project uses the following modules:
| timelines |
@@ -96,6 +90,13 @@ Feature: Timeline View Tests with reporters
| April13 | 2013-04-01 | 2013-04-30 | Aioli Sali Grande | closed | manager |
And there is a project named "ecookbookQ3" of type "Extraordinary Project"
+ And the following types are enabled for projects of type "Extraordinary Project"
+ | Phase1 |
+ | Phase2 |
+ | Phase3 |
+ | Phase4 |
+ | Milestone |
+
And the project "ecookbookQ3" has the parent "ecookbook13"
And I am working in project "ecookbookQ3"
And the user "manager" is a "manager"
@@ -152,6 +153,13 @@ Feature: Timeline View Tests with reporters
When there is a timeline "Testline" for project "ürm"
And I set the first level grouping criteria to "ürm" for the timeline "Testline" of the project called "ürm"
And I set the second level grouping criteria to "Extraordinary Project" for the timeline "Testline" of the project called "ürm"
+ And the following types are enabled for projects of type "Extraordinary Project"
+ | Phase1 |
+ | Phase2 |
+ | Phase3 |
+ | Phase4 |
+ | Milestone |
+
And I wait for timeline to load table
Then I should see the project "ecookbookEmpty"
diff --git a/features/timelines/timeline_wiki_macro.feature b/features/timelines/timeline_wiki_macro.feature
index db8fe1c771..716746b624 100644
--- a/features/timelines/timeline_wiki_macro.feature
+++ b/features/timelines/timeline_wiki_macro.feature
@@ -11,7 +11,7 @@
Feature: Timeline Wiki Macro
Background:
- Given there are the following planning element types:
+ Given there are the following types:
| Name | Is Milestone | In aggregation |
| Phase | false | true |
| Milestone | true | true |
@@ -21,10 +21,6 @@ Feature: Timeline Wiki Macro
| Standard Project |
| Extraordinary Project |
- And the following types are default for projects of type "Standard Project"
- | Phase |
- | Milestone |
-
And there is 1 user with:
| login | manager |
@@ -50,6 +46,10 @@ Feature: Timeline Wiki Macro
| delete_planning_elements |
And there is a project named "ecookbook" of type "Standard Project"
+ And the following types are enabled for projects of type "Standard Project"
+ | Phase |
+ | Milestone |
+
And I am working in project "ecookbook"
And the project uses the following modules:
diff --git a/features/work_packages/work_package_show.feature b/features/work_packages/work_package_show.feature
index 90e1e67b69..aa609e27a5 100644
--- a/features/work_packages/work_package_show.feature
+++ b/features/work_packages/work_package_show.feature
@@ -25,14 +25,9 @@ Feature: Viewing a work package
And there is a issuepriority with:
| name | Immediate |
- And there are the following planning element types:
- | Name | Is Milestone | In aggregation |
- | Phase | false | true |
- And there are the following project types:
- | Name |
- | Standard Project |
- And the following types are default for projects of type "Standard Project"
- | Phase |
+ And there are the following types:
+ | Name | Is Milestone | In aggregation | Is default |
+ | Phase | false | true | true |
And there is a role "member"
And the role "member" may have the following rights:
|