Commit 384cc575e7342ce01ab6f7217ab4d3e01681d5c7
1 parent
88b3e8c4
Exists in
master
and in
28 other branches
Small changes on roles creation and edition
Also: - Added edit button when showing a role - Added button layout to link - Listing permissions by name instead of key - Added cucumber test (ActionItem 2287)
Showing
4 changed files
with
37 additions
and
4 deletions
Show diff stats
app/views/profile_members/change_role.rhtml
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | <%= labelled_check_box(r.name, 'roles[]', r.id, @associations.map(&:role).include?(r) ) %><br/> | 7 | <%= labelled_check_box(r.name, 'roles[]', r.id, @associations.map(&:role).include?(r) ) %><br/> |
8 | <ul class="role-permissions"> | 8 | <ul class="role-permissions"> |
9 | <% r.permissions.each do |p| %> | 9 | <% r.permissions.each do |p| %> |
10 | - <li><%= p %></li> | 10 | + <li> <%= permission_name(p) %> </li> |
11 | <% end %> | 11 | <% end %> |
12 | </ul> | 12 | </ul> |
13 | <% end %> | 13 | <% end %> |
app/views/role/index.rhtml
@@ -18,6 +18,6 @@ | @@ -18,6 +18,6 @@ | ||
18 | </table> | 18 | </table> |
19 | 19 | ||
20 | <% button_bar do %> | 20 | <% button_bar do %> |
21 | - <%= button :back, _('Back'), :controller => 'admin_panel' %> | ||
22 | - <%= button :add, _('New'), :action => 'new' %> | 21 | + <%= button :add, _('Create a new role'), :action => 'new' %> |
22 | + <%= button :back, _('Back to admin panel'), :controller => 'admin_panel' %> | ||
23 | <% end %> | 23 | <% end %> |
app/views/role/show.rhtml
@@ -7,4 +7,7 @@ | @@ -7,4 +7,7 @@ | ||
7 | <% end %> | 7 | <% end %> |
8 | </ul> | 8 | </ul> |
9 | 9 | ||
10 | -<%= link_to _('Back'), :action => 'index' %> | 10 | +<% button_bar do %> |
11 | + <%= button :edit, _('Edit'), :action => 'edit', :id => @role %> | ||
12 | + <%= button :back, _('Back to roles management'), :action => 'index' %> | ||
13 | +<% end %> |
@@ -0,0 +1,30 @@ | @@ -0,0 +1,30 @@ | ||
1 | +Feature: manage roles | ||
2 | + As an environment admin | ||
3 | + I want to create and edit roles | ||
4 | + | ||
5 | + Scenario: create new role | ||
6 | + Given I am logged in as admin | ||
7 | + And I go to the environment control panel | ||
8 | + And I follow "Manage User roles" | ||
9 | + Then I should not see "My new role" | ||
10 | + And I follow "Create a new role" | ||
11 | + And I fill in "Name" with "My new role" | ||
12 | + And I check "Publish content" | ||
13 | + And I press "Create role" | ||
14 | + And I go to the environment control panel | ||
15 | + And I follow "Manage User roles" | ||
16 | + Then I should see "My new role" | ||
17 | + | ||
18 | + Scenario: edit a role | ||
19 | + Given I am logged in as admin | ||
20 | + And I go to the environment control panel | ||
21 | + And I follow "Manage User roles" | ||
22 | + Then I should not see "My new role" | ||
23 | + And I follow "Profile Administrator" | ||
24 | + And I follow "Edit" | ||
25 | + And I fill in "Name" with "My new role" | ||
26 | + And I press "Save changes" | ||
27 | + And I go to the environment control panel | ||
28 | + And I follow "Manage User roles" | ||
29 | + Then I should see "My new role" | ||
30 | + And I should not see "Profile Administrator" |