Fixes even more references to types and cukes.

Removes planning element types, types trough project type association,
default planning element types, obsolete cukes, unised variables and
project types where possible, enhances step definitions, adds step
definitions and fixes some cukes.
pull/1203/head
Martin Czuchra 11 years ago
parent 275aa7d033
commit cca054ebbe
  1. 13
      app/helpers/work_packages_helper.rb
  2. 9
      app/models/type.rb
  3. 10
      app/views/planning_elements/_form.html.erb
  4. 2
      app/views/projects/settings/_timelines.html.erb
  5. 12
      features/planning_elements/planning_element_management.feature
  6. 12
      features/planning_elements/planning_element_textile_link.feature
  7. 9
      features/planning_elements/show.feature
  8. 58
      features/project_types/project_creation_with_type.feature
  9. 24
      features/step_definitions/timelines_given_steps.rb
  10. 54
      features/timelines/timeline_view.feature
  11. 36
      features/timelines/timeline_view_with_reporters.feature
  12. 10
      features/timelines/timeline_wiki_macro.feature
  13. 11
      features/work_packages/work_package_show.feature

@ -6,7 +6,7 @@ module WorkPackagesHelper
end
def ancestors_links
ancestors = controller.ancestors.map do |parent|
controller.ancestors.map do |parent|
link_to '#' + h(parent.id), work_package_path(parent.id)
end
end
@ -81,7 +81,6 @@ module WorkPackagesHelper
def work_package_form_top_attributes(form, work_package, locals = {})
[
work_package_form_type_attribute(form, work_package, locals),
work_package_form_planning_element_type_attribute(form, work_package, locals),
work_package_form_subject_attribute(form, work_package, locals),
work_package_form_parent_attribute(form, work_package, locals),
work_package_form_description_attribute(form, work_package, locals)
@ -213,16 +212,6 @@ module WorkPackagesHelper
end
end
def work_package_form_planning_element_type_attribute(form, work_package, locals = {})
if work_package.is_a?(PlanningElement)
field = form.select :planning_element_type_id,
(locals[:project].types.collect { |m| [m.name, m.id] }),
:include_blank => true
WorkPackageAttribute.new(:type, field)
end
end
def work_package_form_subject_attribute(form, work_package, locals = {})
WorkPackageAttribute.new :subject, form.text_field(:subject, :size => 80, :required => true)
end

@ -100,14 +100,7 @@ class Type < ActiveRecord::Base
end
def enabled_in?(object)
case object
when ProjectType
object.types.include?(self)
when Project
object.types.include?(self)
else
false
end
object.types.include?(self)
end
def available_colors

@ -62,16 +62,6 @@ See doc/COPYRIGHT.rdoc for more details.
<%= wikitoolbar_for 'planning_element_description' %>
</td>
</tr>
<tr>
<th class="planning-element-type">
<label for="planning_element_type_id">
<%= PlanningElement.human_attribute_name(:type) %>:
</label>
</th>
<td class="planning-element-type">
<%= f.select :planning_element_type_id, (project.types.collect { |m| [m.name, m.id] }), :include_blank => true %>
</td>
</tr>
<tr>
<th class="responsible">
<label for="planning_element_responsible_id">

@ -30,7 +30,7 @@ See doc/COPYRIGHT.rdoc for more details.
<% Type.all.each do |type| %>
<tr class="<%= cycle('odd', 'even', :name => "pet_table") %>">
<td class='center'>
<%= checked_image(type.enabled_in?(@project.project_type)) %>
<%= checked_image(type.enabled_in?(@project)) %>
</td>
<td class='center'>
<%= check_box_tag "project[planning_element_type_ids][]",

@ -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 |

@ -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 |

@ -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 |

@ -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

@ -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

@ -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"

@ -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"

@ -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:

@ -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:

Loading…
Cancel
Save