From 4053cfe6925697ccac089af8c0db158a8bba3f28 Mon Sep 17 00:00:00 2001 From: Mark Maglana Date: Thu, 2 Sep 2010 00:39:35 +0800 Subject: [PATCH] Fix common.feature --- features/common.feature | 4 ++-- features/step_definitions/_given_steps.rb | 18 +++++------------- features/step_definitions/_when_steps.rb | 2 +- features/step_definitions/helpers.rb | 16 ++++++++-------- 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/features/common.feature b/features/common.feature index 0d56f21842..7513960020 100644 --- a/features/common.feature +++ b/features/common.feature @@ -1,11 +1,11 @@ -Feature: Product Owner +Feature: Common 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 + And I am a team member of the project Scenario: View the product backlog Given I am viewing the master backlog diff --git a/features/step_definitions/_given_steps.rb b/features/step_definitions/_given_steps.rb index 5b2a09e04c..73c3868c97 100644 --- a/features/step_definitions/_given_steps.rb +++ b/features/step_definitions/_given_steps.rb @@ -1,35 +1,27 @@ -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 - Given /^I am a product owner of the project$/ do role = Role.find(:first, :conditions => "name='Manager'") - role.permissions << :manage_backlog + role.permissions << :view_master_backlog role.save! login_as_product_owner 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.permissions << :view_master_backlog + role.permissions << :view_sprints role.save! login_as_scrum_master end Given /^I am a team member of the project$/ do role = Role.find(:first, :conditions => "name='Manager'") - role.permissions << :manage_backlog - role.permissions << :view_backlog + role.permissions << :view_master_backlog role.save! login_as_team_member end Given /^I am viewing the master backlog$/ do - visit url_for(:controller => 'backlogs', :action=>'index', :project_id => @project) + visit url_for(:controller => :rb_master_backlogs, :action => :show, :id => @project) page.driver.response.status.should == 200 end diff --git a/features/step_definitions/_when_steps.rb b/features/step_definitions/_when_steps.rb index 4a8157fe36..ac52fccf41 100644 --- a/features/step_definitions/_when_steps.rb +++ b/features/step_definitions/_when_steps.rb @@ -59,7 +59,7 @@ When /^I move the (\d+)(?:st|nd|rd|th) story to the (\d+|last)(?:st|nd|rd|th)? p end When /^I request the server_variables resource$/ do - visit url_for(:controller => 'server_variables', :action => 'index', :project_id => @project.id) + visit url_for(:controller => :rb_server_variables, :action => :show, :id => @project.id) end When /^I update the sprint$/ do diff --git a/features/step_definitions/helpers.rb b/features/step_definitions/helpers.rb index f040a6b7d0..f32659939e 100644 --- a/features/step_definitions/helpers.rb +++ b/features/step_definitions/helpers.rb @@ -20,14 +20,6 @@ def initialize_task_params(story_id) params 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 - def login_as_product_owner visit url_for(:controller => 'account', :action=>'login') fill_in 'username', :with => 'jsmith' @@ -51,3 +43,11 @@ def login_as_team_member click_button 'Login »' @user = User.find(:first, :conditions => "login='jsmith'") end + +def login_as_admin + visit url_for(:controller => 'account', :action=>'login') + fill_in 'username', :with => 'admin' + fill_in 'password', :with => 'admin' + click_button 'Login »' + @user = User.find(:first, :conditions => "login='admin'") +end \ No newline at end of file