diff --git a/features/scrum_master.feature b/features/scrum_master.feature index 8280c1c494..6daac32cdf 100644 --- a/features/scrum_master.feature +++ b/features/scrum_master.feature @@ -47,7 +47,8 @@ Feature: Scrum Master And Story 2 should be in the 1st position of the sprint named Sprint 002 Scenario: Request the project calendar feed - Given I have my set my API access key - And I am viewing the issues list - And I download the calendar feed - Then the request should complete successfully + Given I have set my API access key + And I am viewing the issues list + When I download the calendar feed + Then the request should complete successfully + \ No newline at end of file diff --git a/features/step_definitions/_given_steps.rb b/features/step_definitions/_given_steps.rb index 6c28c938f7..06e4af38d8 100644 --- a/features/step_definitions/_given_steps.rb +++ b/features/step_definitions/_given_steps.rb @@ -15,6 +15,7 @@ end Given /^I am a scrum master of the project$/ do role = Role.find(:first, :conditions => "name='Manager'") role.permissions << :manage_backlog + role.permissions << :view_backlog role.save! login_as_scrum_master end @@ -147,23 +148,8 @@ Given /^I am viewing the issues list$/ do page.driver.response.status.should == 200 end -Given /^I have my set my API access key$/ do - if ! Setting.rest_api_enabled? - post url_for(:controller => 'settings', :action => 'edit', :settings_rest_api_enabled => '1') - page.driver.response.status.should == 200 - raise "Failed to enable the REST API" unless Setting.rest_api_enabled? - end - - if ! @user.api_token - post url_for(:controller => 'my', :action => 'reset_api_key') - page.driver.response.status.should == 200 - end - +Given /^I have set my API access key$/ do + Setting[:rest_api_enabled] = 1 @user.reload - - @user.api_token.should_not be_nil -end - -Given /^I download the calendar feed$/ do - visit url_for({ :only_path => true, :key => @user.api_key, :controller => 'backlogs', :action => 'calendar', :format => 'xml', :project_id => @project }) -end + @user.api_key.should_not be_nil +end \ No newline at end of file diff --git a/features/step_definitions/_when_steps.rb b/features/step_definitions/_when_steps.rb index c16db1a9df..ba63217f55 100644 --- a/features/step_definitions/_when_steps.rb +++ b/features/step_definitions/_when_steps.rb @@ -74,6 +74,10 @@ When /^I update the story$/ do @story_params end +When /^I download the calendar feed$/ do + visit url_for({ :key => @user.api_key, :controller => 'backlogs', :action => 'calendar', :format => 'xml', :project_id => @project }) +end + When /^I view the stories in (.+) in the issues tab/ do |sprint_name| sprint = Sprint.find(:first, :conditions => "name='#{sprint_name}'") visit url_for(:controller => 'backlogs', :action => 'select_issues', :project_id=> sprint.project_id, :sprint_id => sprint.id)