Refactoring scenarios to use own trackers instead of default-fixture ones

pull/6827/head
Gregor Schmidt 14 years ago
parent ebb24c81a9
commit 1a22b207e9
  1. 8
      features/edit_story.feature
  2. 13
      features/product_owner.feature
  3. 21
      features/scrum_master.feature
  4. 20
      features/shared_versions.feature
  5. 51
      features/step_definitions/_given_steps.rb
  6. 8
      features/team_member.feature

@ -9,7 +9,13 @@ Feature: Edit story on backlogs view
And I am working in project "ecookbook"
And the project uses the following modules:
| backlogs |
And the backlogs module is initialized
And the following trackers are configured to track stories:
| Story |
| Epic |
And the tracker "Task" is configured to track tasks
And the project uses the following trackers:
| Story |
| Task |
And there is 1 user with:
| login | mathias |
And there is a role "team member"

@ -9,7 +9,14 @@ Feature: Product Owner
And I am working in project "ecookbook"
And the project uses the following modules:
| backlogs |
And the backlogs module is initialized
And the following trackers are configured to track stories:
| Story |
| Epic |
And the tracker "Task" is configured to track tasks
And the project uses the following trackers:
| Story |
| Epic |
| Task |
And there is 1 user with:
| login | mathias |
And there is a role "product owner"
@ -62,10 +69,10 @@ Feature: Product Owner
Given I am on the master backlog
And I want to edit the story with subject Story 3
And I set the subject of the story to Relaxdiego was here
And I set the tracker of the story to Bug
And I set the tracker of the story to Epic
When I update the story
Then the story should have a subject of Relaxdiego was here
And the story should have a tracker of Bug
And the story should have a tracker of Epic
And the story should be at position 3
Scenario: Close a story

@ -9,7 +9,6 @@ Feature: Scrum Master
And I am working in project "ecookbook"
And the project uses the following modules:
| backlogs |
And the backlogs module is initialized
And there is a role "scrum master"
And the role "scrum master" may have the following rights:
| view_master_backlog |
@ -25,6 +24,16 @@ Feature: Scrum Master
| view_issues |
| edit_issues |
| manage_subtasks |
And the backlogs module is initialized
And the following trackers are configured to track stories:
| Story |
And the tracker "Task" is configured to track tasks
And the project uses the following trackers:
| Story |
| Epic |
| Task |
| Bug |
And the tracker "Task" has the default workflow for the role "scrum master"
And there is 1 user with:
| login | markus |
| firstname | Markus |
@ -51,13 +60,6 @@ Feature: Scrum Master
| 5 | Story A | Sprint 001 |
| 6 | Story B | Sprint 001 |
| 7 | Story C | Sprint 002 |
And there are the following trackers:
| name |
| Task |
And the project has the following trackers:
| name |
| Epic |
And the tracker "Task" is configured to track tasks
And there are the following issue status:
| name | is_closed | is_default |
| New | false | true |
@ -65,7 +67,6 @@ Feature: Scrum Master
| Resolved | false | false |
| Closed | true | false |
| Rejected | true | false |
And the tracker "Task" has the default workflow for the role "scrum master"
And the project has the following tasks:
| subject | sprint | parent |
| Task 1 | Sprint 001 | Story A |
@ -301,4 +302,4 @@ Feature: Scrum Master
Then the request should complete successfully
And Task 11 should be the higher task of Task 10
And the story named Story D should have 1 task named Task 10
And the story named Story D should have 1 task named Task 11
And the story named Story D should have 1 task named Task 11

@ -6,16 +6,24 @@ Feature: Shared Versions
Background:
Given there is 1 project with:
| name | parent |
And I am working in project "parent"
And the project has the following sprints:
And the project "parent" has the following sprints:
| name | sharing | sprint_start_date | effective_date |
| ParentSprint | system | 2010-01-01 | 2010-01-31 |
And there is 1 project with:
| name | child |
And I am working in project "child"
And the project uses the following modules:
And the project "child" uses the following modules:
| backlogs |
And the backlogs module is initialized
And the following trackers are configured to track stories:
| story |
| epic |
And the tracker "task" is configured to track tasks
And the project "parent" uses the following trackers:
| story |
| task |
And the project "child" uses the following trackers:
| story |
| task |
And I am working in project "child"
And there is 1 user with:
| login | padme |
And there is a role "project admin"
@ -46,4 +54,4 @@ Feature: Shared Versions
| 1 | ChildStory | ParentSprint |
And I am on the master backlog
Then I should see "ChildStory" within ".backlog .story .subject"
And I should not see "ParentStory" within ".backlog .story .subject"
And I should not see "ParentStory" within ".backlog .story .subject"

@ -81,13 +81,23 @@ end
Given /^the backlogs module is initialized(?: in [pP]roject "(.*)")?$/ do |project_name|
project = get_project(project_name)
# Configure the story and task trackers
story_trackers = Tracker.find(:all).map{|s| "#{s.id}"}
task_tracker = "#{Tracker.create!(:name => 'Task').id}"
Setting.plugin_redmine_backlogs = {:story_trackers => story_trackers, :task_tracker => task_tracker }
Given 'the following trackers are configured to track stories:', Cucumber::Ast::Table.new([['Story'], ['Epic']])
Given 'the tracker "Task" is configured to track tasks'
Given "the project \"#{project.name}\" uses the following trackers:", Cucumber::Ast::Table.new([['Story', 'Task']])
end
Given /^the [pP]roject(?: "([^\"]+?)")? uses the following trackers:$/ do |project, table|
project = get_project(project)
# Make sure these trackers are enabled in the project
project.update_attributes :tracker_ids => (story_trackers << task_tracker)
trackers = table.raw.map do |line|
name = line.first
tracker = Tracker.find_by_name(name)
tracker = Factory.create(:tracker, :name => name) if tracker.blank?
tracker
end
project.update_attributes :tracker_ids => trackers.map(&:id).map(&:to_s)
end
Given /^the [pP]roject(?: "([^\"]*)")? has the following sprints:$/ do |project_name, table|
@ -145,7 +155,12 @@ Given /^the [pP]roject(?: "([^\"]*)")? has the following stories in the followin
# NOTE: We're bypassing the controller here because we're just
# setting up the database for the actual tests. The actual tests,
# however, should NOT bypass the controller
s = Story.create_and_position params
begin
s = Story.create_and_position params
rescue
debugger
true
end
prev_id = s.id
end
end
@ -183,7 +198,12 @@ Given /^the [pP]roject(?: "([^\"]*)")? has the following issues:$/ do |project_n
# NOTE: We're bypassing the controller here because we're just
# setting up the database for the actual tests. The actual tests,
# however, should NOT bypass the controller
Issue.create!(params)
begin
Issue.create!(params)
rescue
debugger
raise
end
end
end
@ -289,5 +309,20 @@ end
Given /^the tracker "(.+?)" is configured to track tasks$/ do |tracker_name|
tracker = Tracker.find_by_name(tracker_name)
tracker = Factory.create(:tracker, :name => tracker_name) if tracker.blank?
Setting.plugin_redmine_backlogs = Setting.plugin_redmine_backlogs.merge(:task_tracker => tracker.id)
end
Given /^the following trackers are configured to track stories:$/ do |table|
story_trackers = []
table.raw.each do |line|
name = line.first
tracker = Tracker.find_by_name(name)
tracker = Factory.create(:tracker, :name => name) if tracker.blank?
story_trackers << tracker
end
Setting.plugin_redmine_backlogs = Setting.plugin_redmine_backlogs.merge(:story_trackers => story_trackers.map(&:id))
end

@ -9,7 +9,13 @@ Feature: Team Member
And I am working in project "ecookbook"
And the project uses the following modules:
| backlogs |
And the backlogs module is initialized
And the following trackers are configured to track stories:
| Story |
| Epic |
And the tracker "Task" is configured to track tasks
And the project uses the following trackers:
| Story |
| Task |
And there is 1 user with:
| login | paul |
And there is a role "team member"

Loading…
Cancel
Save