Commit 4e5b3d9aaebd420fc95152540a664a17ec3019e7

Authored by Dmitriy Zaporozhets
1 parent 48019f1a

Fixin tests

app/views/admin/groups/show.html.haml
@@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
65 .span6 65 .span6
66 .ui-box 66 .ui-box
67 %h5.title 67 %h5.title
68 - Add user to the group: 68 + Add user(s):
69 .ui-box-body.form-holder 69 .ui-box-body.form-holder
70 %p.light 70 %p.light
71 Read more about project permissions 71 Read more about project permissions
@@ -77,7 +77,7 @@ @@ -77,7 +77,7 @@
77 %div.prepend-top-10 77 %div.prepend-top-10
78 = select_tag :project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span2"} 78 = select_tag :project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span2"}
79 %hr 79 %hr
80 - = submit_tag 'Add user to the group', class: "btn btn-create" 80 + = submit_tag 'Add users into group', class: "btn btn-create"
81 .ui-box 81 .ui-box
82 %h5.title 82 %h5.title
83 Users from #{@group.name} Group 83 Users from #{@group.name} Group
features/steps/admin/admin_groups.rb
@@ -45,7 +45,7 @@ class AdminGroups < Spinach::FeatureSteps @@ -45,7 +45,7 @@ class AdminGroups < Spinach::FeatureSteps
45 within "#new_team_member" do 45 within "#new_team_member" do
46 select "Reporter", from: "project_access" 46 select "Reporter", from: "project_access"
47 end 47 end
48 - click_button "Add user to projects in group" 48 + click_button "Add users into group"
49 end 49 end
50 50
51 Then 'I should see "John" in team list in every project as "Reporter"' do 51 Then 'I should see "John" in team list in every project as "Reporter"' do
features/steps/project/project_team_management.rb
@@ -30,14 +30,20 @@ class ProjectTeamManagement < Spinach::FeatureSteps @@ -30,14 +30,20 @@ class ProjectTeamManagement < Spinach::FeatureSteps
30 end 30 end
31 31
32 Then 'I should see "Mike" in team list as "Reporter"' do 32 Then 'I should see "Mike" in team list as "Reporter"' do
33 - within '.reporters' do 33 + user = User.find_by_name("Mike")
  34 +
  35 + within "#user_#{user.id}" do
34 page.should have_content('Mike') 36 page.should have_content('Mike')
  37 + page.find('#team_member_project_access').value.should == access_value(:reporter)
35 end 38 end
36 end 39 end
37 40
38 Given 'I should see "Sam" in team list as "Developer"' do 41 Given 'I should see "Sam" in team list as "Developer"' do
39 - within '.developers' do 42 + user = User.find_by_name("Sam")
  43 +
  44 + within "#user_#{user.id}" do
40 page.should have_content('Sam') 45 page.should have_content('Sam')
  46 + page.find('#team_member_project_access').value.should == access_value(:developer)
41 end 47 end
42 end 48 end
43 49
@@ -49,8 +55,10 @@ class ProjectTeamManagement < Spinach::FeatureSteps @@ -49,8 +55,10 @@ class ProjectTeamManagement < Spinach::FeatureSteps
49 end 55 end
50 56
51 And 'I should see "Sam" in team list as "Reporter"' do 57 And 'I should see "Sam" in team list as "Reporter"' do
52 - within '.reporters' do 58 + user = User.find_by_name("Sam")
  59 + within ".user_#{user.id}" do
53 page.should have_content('Sam') 60 page.should have_content('Sam')
  61 + page.find('#team_member_project_access').value.should == access_value(:reporter)
54 end 62 end
55 end 63 end
56 64
@@ -103,4 +111,10 @@ class ProjectTeamManagement < Spinach::FeatureSteps @@ -103,4 +111,10 @@ class ProjectTeamManagement < Spinach::FeatureSteps
103 click_link('Remove user from team') 111 click_link('Remove user from team')
104 end 112 end
105 end 113 end
  114 +
  115 + private
  116 +
  117 + def access_value(key)
  118 + UsersProject.roles_hash[key].to_s
  119 + end
106 end 120 end