Commit 4e5b3d9aaebd420fc95152540a664a17ec3019e7

Authored by Dmitriy Zaporozhets
1 parent 48019f1a

Fixin tests

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