Fix common.feature

pull/6827/head
Mark Maglana 14 years ago
parent b37db7fdb2
commit 4053cfe692
  1. 4
      features/common.feature
  2. 18
      features/step_definitions/_given_steps.rb
  3. 2
      features/step_definitions/_when_steps.rb
  4. 16
      features/step_definitions/helpers.rb

@ -1,11 +1,11 @@
Feature: Product Owner Feature: Common
As a user As a user
I want to do stuff I want to do stuff
So that I can do my job So that I can do my job
Background: Background:
Given the ecookbook project has the backlogs plugin enabled 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 Scenario: View the product backlog
Given I am viewing the master backlog Given I am viewing the master backlog

@ -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 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 << :manage_backlog role.permissions << :view_master_backlog
role.save! role.save!
login_as_product_owner login_as_product_owner
end end
Given /^I am a scrum master of the project$/ do Given /^I am a scrum master of the project$/ do
role = Role.find(:first, :conditions => "name='Manager'") role = Role.find(:first, :conditions => "name='Manager'")
role.permissions << :manage_backlog role.permissions << :view_master_backlog
role.permissions << :view_backlog role.permissions << :view_sprints
role.save! role.save!
login_as_scrum_master login_as_scrum_master
end end
Given /^I am a team member of the project$/ do Given /^I am a team member of the project$/ do
role = Role.find(:first, :conditions => "name='Manager'") role = Role.find(:first, :conditions => "name='Manager'")
role.permissions << :manage_backlog role.permissions << :view_master_backlog
role.permissions << :view_backlog
role.save! role.save!
login_as_team_member login_as_team_member
end end
Given /^I am viewing the master backlog$/ do 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 page.driver.response.status.should == 200
end end

@ -59,7 +59,7 @@ When /^I move the (\d+)(?:st|nd|rd|th) story to the (\d+|last)(?:st|nd|rd|th)? p
end end
When /^I request the server_variables resource$/ do 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 end
When /^I update the sprint$/ do When /^I update the sprint$/ do

@ -20,14 +20,6 @@ def initialize_task_params(story_id)
params params
end 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 def login_as_product_owner
visit url_for(:controller => 'account', :action=>'login') visit url_for(:controller => 'account', :action=>'login')
fill_in 'username', :with => 'jsmith' fill_in 'username', :with => 'jsmith'
@ -51,3 +43,11 @@ def login_as_team_member
click_button 'Login »' click_button 'Login »'
@user = User.find(:first, :conditions => "login='jsmith'") @user = User.find(:first, :conditions => "login='jsmith'")
end 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
Loading…
Cancel
Save