Fix product_owner.feature

pull/6827/head
Mark Maglana 14 years ago
parent 4053cfe692
commit e1875f884c
  1. 5
      features/product_owner.feature
  2. 5
      features/step_definitions/_given_steps.rb
  3. 15
      features/step_definitions/_when_steps.rb
  4. 724
      lib/labels.yaml

@ -44,7 +44,10 @@ Feature: Product Owner
Scenario: Close a story Scenario: Close a story
Given I am viewing the master backlog Given I am viewing the master backlog
When I close Story 2 And I want to update the story with subject Story 4
And I set the status of the story to Closed
When I update the story
Then show me the page
Then the status of the story should be set as closed Then the status of the story should be set as closed
Scenario: Move a story to the top Scenario: Move a story to the top

@ -1,6 +1,8 @@
Given /^I am a product owner of the project$/ do Given /^I am a product owner of the project$/ do
role = Role.find(:first, :conditions => "name='Manager'") role = Role.find(:first, :conditions => "name='Manager'")
role.permissions << :view_master_backlog role.permissions << :view_master_backlog
role.permissions << :create_stories
role.permissions << :update_stories
role.save! role.save!
login_as_product_owner login_as_product_owner
end end
@ -41,6 +43,9 @@ Given /^I set the (.+) of the story to (.+)$/ do |attribute, value|
if attribute=="tracker" if attribute=="tracker"
attribute="tracker_id" attribute="tracker_id"
value = Tracker.find(:first, :conditions => "name='#{value}'").id value = Tracker.find(:first, :conditions => "name='#{value}'").id
elsif attribute=="status"
attribute="status_id"
value = IssueStatus.find(:first, :conditions => "name='#{value}'").id
end end
@story_params[attribute] = value @story_params[attribute] = value
end end

@ -1,12 +1,6 @@
When /^I close (.+)$/ do |subject|
@story = Story.find(:first, :conditions => "subject='#{subject}'")
@story.should_not be_nil
@story.update_attributes :status_id => IssueStatus.find(:first, :conditions => "name='Closed'").id
end
When /^I create the story$/ do When /^I create the story$/ do
page.driver.process :post, page.driver.process :post,
url_for(:controller => 'stories', :action => 'create'), url_for(:controller => :rb_stories, :action => :create),
@story_params @story_params
end end
@ -52,8 +46,8 @@ When /^I move the (\d+)(?:st|nd|rd|th) story to the (\d+|last)(?:st|nd|rd|th)? p
end end
page.driver.process :post, page.driver.process :post,
url_for(:controller => 'stories', :action => 'update'), url_for(:controller => :rb_stories, :action => :update, :id => story.text),
{:id => story.text, :prev => (prev.nil? ? '' : prev.text), :project_id => @project.id} {:prev => (prev.nil? ? '' : prev.text), :project_id => @project.id, "_method" => "put"}
@story = Story.find(story.text.to_i) @story = Story.find(story.text.to_i)
end end
@ -70,8 +64,9 @@ end
When /^I update the story$/ do When /^I update the story$/ do
page.driver.process :post, page.driver.process :post,
url_for(:controller => 'stories', :action => 'update'), url_for(:controller => :rb_stories, :action => :update, :id => @story_params[:id]),
@story_params @story_params
page.driver.response.status.should == 200
end end
When /^I download the calendar feed$/ do When /^I download the calendar feed$/ do

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save