Testing that velocity is correctly updated when a new story is added or an existing one is updated

pull/6827/head
Gregor Schmidt 14 years ago
parent 83e79a37e4
commit 13107db281
  1. 10
      features/edit_story.feature
  2. 1
      features/step_definitions/_given_steps.rb
  3. 5
      features/step_definitions/_then_steps.rb

@ -37,9 +37,9 @@ Feature: Edit story on backlogs view
| 3 | Story 3 | Product Backlog | | 3 | Story 3 | Product Backlog |
| 4 | Story 4 | Product Backlog | | 4 | Story 4 | Product Backlog |
And the project has the following stories in the following sprints: And the project has the following stories in the following sprints:
| position | subject | sprint | | position | subject | sprint | story_points |
| 5 | Story A | Sprint 001 | | 5 | Story A | Sprint 001 | 10 |
| 6 | Story B | Sprint 001 | | 6 | Story B | Sprint 001 | 20 |
And I am logged in as "mathias" And I am logged in as "mathias"
@javascript @javascript
@ -60,9 +60,11 @@ Feature: Edit story on backlogs view
And I follow "New Story" within the "Sprint 001" menu And I follow "New Story" within the "Sprint 001" menu
And I close the "Sprint 001" menu And I close the "Sprint 001" menu
And I fill in "The Wizard of Oz" for "subject" And I fill in "The Wizard of Oz" for "subject"
And I fill in "3" for "story_points"
And I confirm the story form And I confirm the story form
Then the 1st story in the "Sprint 001" should be "The Wizard of Oz" Then the 1st story in the "Sprint 001" should be "The Wizard of Oz"
And I should see 3 stories in "Sprint 001" And I should see 3 stories in "Sprint 001"
And the velocity of "Sprint 001" should be "33"
@javascript @javascript
Scenario: Edit story in the backlog Scenario: Edit story in the backlog
@ -78,6 +80,8 @@ Feature: Edit story on backlogs view
Given I am on the master backlog Given I am on the master backlog
When I click on the text "Story A" When I click on the text "Story A"
And I fill in "Story A revisited" for "subject" And I fill in "Story A revisited" for "subject"
And I fill in "11" for "story_points"
And I confirm the story form And I confirm the story form
Then the 1st story in the "Sprint 001" should be "Story A revisited" Then the 1st story in the "Sprint 001" should be "Story A revisited"
And I should see 2 stories in "Sprint 001" And I should see 2 stories in "Sprint 001"
And the velocity of "Sprint 001" should be "31"

@ -137,6 +137,7 @@ Given /^the [pP]roject(?: "([^\"]*)")? has the following stories in the followin
params['subject'] = story['subject'] params['subject'] = story['subject']
params['prev_id'] = prev_id params['prev_id'] = prev_id
params['fixed_version_id'] = Version.find_by_name(story['sprint'] || story['backlog']).id params['fixed_version_id'] = Version.find_by_name(story['sprint'] || story['backlog']).id
params['story_points'] = story['story_points']
# NOTE: We're bypassing the controller here because we're just # NOTE: We're bypassing the controller here because we're just
# setting up the database for the actual tests. The actual tests, # setting up the database for the actual tests. The actual tests,

@ -35,6 +35,11 @@ Then /^I should see (\d+) stories in (?:the )?"(.+?)"$/ do |count, backlog_name|
page.all(:css, "#backlog_#{sprint.id} .story").size.should == count.to_i page.all(:css, "#backlog_#{sprint.id} .story").size.should == count.to_i
end end
Then /^the velocity of "(.+?)" should be "(.+?)"$/ do |backlog_name, velocity|
sprint = Sprint.find_by_name(backlog_name)
page.find(:css, "#backlog_#{sprint.id} .velocity").text.should == velocity
end
Then /^show me the list of sprints$/ do Then /^show me the list of sprints$/ do
sprints = Sprint.find(:all, :conditions => ["project_id=?", @project.id]) sprints = Sprint.find(:all, :conditions => ["project_id=?", @project.id])

Loading…
Cancel
Save