Commit d274ca38 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix random failing tests with project teams

parent 6e35acef
- user = member.user - user = member.user
- allow_admin = current_user_can_admin_project - allow_admin = current_user_can_admin_project
%li{id: dom_id(user), class: "team_member_row user_#{user.id}"} %li{id: dom_id(user), class: "team_member_row access-#{member.human_access.downcase}"}
.pull-right .pull-right
- if allow_admin - if allow_admin
.pull-left .pull-left
......
...@@ -30,35 +30,27 @@ class ProjectTeamManagement < Spinach::FeatureSteps ...@@ -30,35 +30,27 @@ class ProjectTeamManagement < Spinach::FeatureSteps
end end
Then 'I should see "Mike" in team list as "Reporter"' do Then 'I should see "Mike" in team list as "Reporter"' do
user = User.find_by_name("Mike") within ".access-reporter" do
within "#user_#{user.id}" do
page.should have_content('Mike') page.should have_content('Mike')
page.find('#team_member_project_access').value.should == access_value(:reporter)
end end
end end
Given 'I should see "Sam" in team list as "Developer"' do Given 'I should see "Sam" in team list as "Developer"' do
user = User.find_by_name("Sam") within ".access-developer" do
within "#user_#{user.id}" do
page.should have_content('Sam') page.should have_content('Sam')
page.find('#team_member_project_access').value.should == access_value(:developer)
end end
end end
And 'I change "Sam" role to "Reporter"' do And 'I change "Sam" role to "Reporter"' do
user = User.find_by_name("Sam") user = User.find_by_name("Sam")
within ".user_#{user.id}" do within "#user_#{user.id}" do
select "Reporter", from: "team_member_project_access" select "Reporter", from: "team_member_project_access"
end end
end end
And 'I should see "Sam" in team list as "Reporter"' do And 'I should see "Sam" in team list as "Reporter"' do
user = User.find_by_name("Sam") within ".access-reporter" do
within ".user_#{user.id}" do
page.should have_content('Sam') page.should have_content('Sam')
page.find('#team_member_project_access').value.should == access_value(:reporter)
end end
end end
...@@ -111,10 +103,4 @@ class ProjectTeamManagement < Spinach::FeatureSteps ...@@ -111,10 +103,4 @@ class ProjectTeamManagement < Spinach::FeatureSteps
click_link('Remove user from team') click_link('Remove user from team')
end end
end end
private
def access_value(key)
UsersProject.roles_hash[key].to_s
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment