Commit d274ca3888b1d099fc80ba135754df81243cee6e
1 parent
6e35acef
Exists in
master
and in
4 other branches
Fix random failing tests with project teams
Showing
2 changed files
with
5 additions
and
19 deletions
Show diff stats
app/views/team_members/_team_member.html.haml
features/steps/project/project_team_management.rb
... | ... | @@ -30,35 +30,27 @@ class ProjectTeamManagement < Spinach::FeatureSteps |
30 | 30 | end |
31 | 31 | |
32 | 32 | Then 'I should see "Mike" in team list as "Reporter"' do |
33 | - user = User.find_by_name("Mike") | |
34 | - | |
35 | - within "#user_#{user.id}" do | |
33 | + within ".access-reporter" do | |
36 | 34 | page.should have_content('Mike') |
37 | - page.find('#team_member_project_access').value.should == access_value(:reporter) | |
38 | 35 | end |
39 | 36 | end |
40 | 37 | |
41 | 38 | Given 'I should see "Sam" in team list as "Developer"' do |
42 | - user = User.find_by_name("Sam") | |
43 | - | |
44 | - within "#user_#{user.id}" do | |
39 | + within ".access-developer" do | |
45 | 40 | page.should have_content('Sam') |
46 | - page.find('#team_member_project_access').value.should == access_value(:developer) | |
47 | 41 | end |
48 | 42 | end |
49 | 43 | |
50 | 44 | And 'I change "Sam" role to "Reporter"' do |
51 | 45 | user = User.find_by_name("Sam") |
52 | - within ".user_#{user.id}" do | |
46 | + within "#user_#{user.id}" do | |
53 | 47 | select "Reporter", from: "team_member_project_access" |
54 | 48 | end |
55 | 49 | end |
56 | 50 | |
57 | 51 | And 'I should see "Sam" in team list as "Reporter"' do |
58 | - user = User.find_by_name("Sam") | |
59 | - within ".user_#{user.id}" do | |
52 | + within ".access-reporter" do | |
60 | 53 | page.should have_content('Sam') |
61 | - page.find('#team_member_project_access').value.should == access_value(:reporter) | |
62 | 54 | end |
63 | 55 | end |
64 | 56 | |
... | ... | @@ -111,10 +103,4 @@ class ProjectTeamManagement < Spinach::FeatureSteps |
111 | 103 | click_link('Remove user from team') |
112 | 104 | end |
113 | 105 | end |
114 | - | |
115 | - private | |
116 | - | |
117 | - def access_value(key) | |
118 | - UsersProject.roles_hash[key].to_s | |
119 | - end | |
120 | 106 | end | ... | ... |