diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-19 20:38:43 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-19 20:38:43 +0400 |
commit | d274ca3888b1d099fc80ba135754df81243cee6e (patch) | |
tree | 338f9368e3da118baddcf7bf03226c3f02bf8d43 /features | |
parent | 6e35aceff29ddeae6282de31e81e48446ab927fa (diff) |
Fix random failing tests with project teams
Diffstat (limited to 'features')
-rw-r--r-- | features/steps/project/project_team_management.rb | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/features/steps/project/project_team_management.rb b/features/steps/project/project_team_management.rb index 7e9533de8f6..af41fd42612 100644 --- a/features/steps/project/project_team_management.rb +++ b/features/steps/project/project_team_management.rb @@ -30,35 +30,27 @@ class ProjectTeamManagement < Spinach::FeatureSteps end Then 'I should see "Mike" in team list as "Reporter"' do - user = User.find_by_name("Mike") - - within "#user_#{user.id}" do + within ".access-reporter" do page.should have_content('Mike') - page.find('#team_member_project_access').value.should == access_value(:reporter) end end Given 'I should see "Sam" in team list as "Developer"' do - user = User.find_by_name("Sam") - - within "#user_#{user.id}" do + within ".access-developer" do page.should have_content('Sam') - page.find('#team_member_project_access').value.should == access_value(:developer) end end And 'I change "Sam" role to "Reporter"' do user = User.find_by_name("Sam") - within ".user_#{user.id}" do + within "#user_#{user.id}" do select "Reporter", from: "team_member_project_access" end end And 'I should see "Sam" in team list as "Reporter"' do - user = User.find_by_name("Sam") - within ".user_#{user.id}" do + within ".access-reporter" do page.should have_content('Sam') - page.find('#team_member_project_access').value.should == access_value(:reporter) end end @@ -111,10 +103,4 @@ class ProjectTeamManagement < Spinach::FeatureSteps click_link('Remove user from team') end end - - private - - def access_value(key) - UsersProject.roles_hash[key].to_s - end end |