diff --git a/features/common.feature b/features/common.feature new file mode 100644 index 0000000000..0d56f21842 --- /dev/null +++ b/features/common.feature @@ -0,0 +1,13 @@ +Feature: Product Owner + As a user + I want to do stuff + So that I can do my job + + Background: + Given the ecookbook project has the backlogs plugin enabled + And I am a member of the project + + Scenario: View the product backlog + Given I am viewing the master backlog + When I request the server_variables resource + Then the request should complete successfully diff --git a/features/step_definitions/global_steps.rb b/features/step_definitions/common_steps.rb similarity index 79% rename from features/step_definitions/global_steps.rb rename to features/step_definitions/common_steps.rb index 11c3cc7b78..63ddf7c49c 100644 --- a/features/step_definitions/global_steps.rb +++ b/features/step_definitions/common_steps.rb @@ -56,6 +56,14 @@ Given /^the project has the following stories in the product backlog:$/ do |tabl end +Given /^I am a member of the project$/ do + role = Role.find(:first, :conditions => "name='Manager'") + role.permissions << :manage_backlog + role.save! + login_as_member +end + + # # Scenario steps @@ -65,10 +73,22 @@ Given /^I am viewing the master backlog$/ do visit url_for(:controller => 'backlogs', :action=>'index', :project_id => @project) end +When /^I request the server_variables resource$/ do + visit url_for(:controller => 'server_variables', :action => 'index', :project_id => @project.id) +end + Then /^the request should complete successfully$/ do page.driver.response.status.should == 200 end def get_project(identifier) Project.find(:first, :conditions => "identifier='#{identifier}'") +end + +def login_as_member + visit url_for(:controller => 'account', :action=>'login') + fill_in 'username', :with => 'jsmith' + fill_in 'password', :with => 'jsmith' + click_button 'Login ยป' + @user = User.find(:first, :conditions => "login='jsmith'") end \ No newline at end of file