BigW Consortium Gitlab

Commit d274ca38 by Dmitriy Zaporozhets

Fix random failing tests with project teams

parent 6e35acef
- user = member.user
- 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
- if allow_admin
.pull-left
......
......@@ -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
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