Fixed the calendar test scenario

pull/6827/head
Mark Maglana 14 years ago
parent d644b8d795
commit 5e83359452
  1. 9
      features/scrum_master.feature
  2. 24
      features/step_definitions/_given_steps.rb
  3. 4
      features/step_definitions/_when_steps.rb

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

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

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

Loading…
Cancel
Save