Commit 4e5b3d9a authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fixin tests

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