BigW Consortium Gitlab

Commit 4e5b3d9a by Dmitriy Zaporozhets

Fixin tests

parent 48019f1a
......@@ -65,7 +65,7 @@
.span6
.ui-box
%h5.title
Add user to the group:
Add user(s):
.ui-box-body.form-holder
%p.light
Read more about project permissions
......@@ -77,7 +77,7 @@
%div.prepend-top-10
= select_tag :project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span2"}
%hr
= submit_tag 'Add user to the group', class: "btn btn-create"
= submit_tag 'Add users into group', class: "btn btn-create"
.ui-box
%h5.title
Users from #{@group.name} Group
......
......@@ -45,7 +45,7 @@ class AdminGroups < Spinach::FeatureSteps
within "#new_team_member" do
select "Reporter", from: "project_access"
end
click_button "Add user to projects in group"
click_button "Add users into group"
end
Then 'I should see "John" in team list in every project as "Reporter"' do
......
......@@ -30,14 +30,20 @@ class ProjectTeamManagement < Spinach::FeatureSteps
end
Then 'I should see "Mike" in team list as "Reporter"' do
within '.reporters' do
user = User.find_by_name("Mike")
within "#user_#{user.id}" 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
within '.developers' do
user = User.find_by_name("Sam")
within "#user_#{user.id}" do
page.should have_content('Sam')
page.find('#team_member_project_access').value.should == access_value(:developer)
end
end
......@@ -49,8 +55,10 @@ class ProjectTeamManagement < Spinach::FeatureSteps
end
And 'I should see "Sam" in team list as "Reporter"' do
within '.reporters' do
user = User.find_by_name("Sam")
within ".user_#{user.id}" do
page.should have_content('Sam')
page.find('#team_member_project_access').value.should == access_value(:reporter)
end
end
......@@ -103,4 +111,10 @@ 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