[ARVADOS] updated: d8b8e96fe4c07369f1296a174abf6e3aab4092a0
git at public.curoverse.com
git at public.curoverse.com
Mon Aug 25 14:03:35 EDT 2014
Summary of changes:
apps/workbench/app/views/layouts/body.html.erb | 36 +++++++++-----------
.../test/integration/application_layout_test.rb | 38 +++++++---------------
2 files changed, 27 insertions(+), 47 deletions(-)
via d8b8e96fe4c07369f1296a174abf6e3aab4092a0 (commit)
from 32e4350b4ea4c111ae95d9a99712fb86bf0ecb86 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit d8b8e96fe4c07369f1296a174abf6e3aab4092a0
Author: radhika <radhika at curoverse.com>
Date: Mon Aug 25 13:56:05 2014 -0400
3620: display gear menu to admin users only. update the layout tests accordingly.
diff --git a/apps/workbench/app/views/layouts/body.html.erb b/apps/workbench/app/views/layouts/body.html.erb
index 3f95be3..0f4c5fe 100644
--- a/apps/workbench/app/views/layouts/body.html.erb
+++ b/apps/workbench/app/views/layouts/body.html.erb
@@ -78,7 +78,7 @@
</ul>
</li>
- <% if current_user.is_active %>
+ <% if current_user.is_admin %>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" id="system-menu">
<span class="fa fa-lg fa-gear"></span>
@@ -87,28 +87,24 @@
<li role="presentation" class="dropdown-header">
Settings
</li>
- <% if current_user.andand.is_admin %>
- <li role="presentation"><a href="/repositories">
- <i class="fa fa-lg fa-code-fork fa-fw"></i> Repositories
- </a></li>
- <li role="presentation"><a href="/virtual_machines">
- <i class="fa fa-lg fa-terminal fa-fw"></i> Virtual machines
- </a></li>
- <li role="presentation"><a href="/authorized_keys">
- <i class="fa fa-lg fa-key fa-fw"></i> SSH keys
- </a></li>
- <li role="presentation"><a href="/api_client_authorizations">
- <i class="fa fa-lg fa-ticket fa-fw"></i> API tokens
- </a></li>
- <% end %>
+ <li role="presentation"><a href="/repositories">
+ <i class="fa fa-lg fa-code-fork fa-fw"></i> Repositories
+ </a></li>
+ <li role="presentation"><a href="/virtual_machines">
+ <i class="fa fa-lg fa-terminal fa-fw"></i> Virtual machines
+ </a></li>
+ <li role="presentation"><a href="/authorized_keys">
+ <i class="fa fa-lg fa-key fa-fw"></i> SSH keys
+ </a></li>
+ <li role="presentation"><a href="/api_client_authorizations">
+ <i class="fa fa-lg fa-ticket fa-fw"></i> API tokens
+ </a></li>
<li role="presentation"><a href="/links">
<i class="fa fa-lg fa-arrows-h fa-fw"></i> Links
</a></li>
- <% if current_user.andand.is_admin %>
- <li role="presentation"><a href="/users">
- <i class="fa fa-lg fa-user fa-fw"></i> Users
- </a></li>
- <% end %>
+ <li role="presentation"><a href="/users">
+ <i class="fa fa-lg fa-user fa-fw"></i> Users
+ </a></li>
<li role="presentation"><a href="/groups">
<i class="fa fa-lg fa-users fa-fw"></i> Groups
</a></li>
diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb
index 99eed01..e3441c4 100644
--- a/apps/workbench/test/integration/application_layout_test.rb
+++ b/apps/workbench/test/integration/application_layout_test.rb
@@ -75,38 +75,22 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
end
def verify_system_menu user
- if user && user['is_active']
- look_for_add_new = nil
+ if user && user['is_admin']
+ assert page.has_link?('system-menu'), 'No link - system menu'
within('.navbar-fixed-top') do
page.find("#system-menu").click
- if user['is_admin']
- within('.dropdown-menu') do
- assert page.has_text?('Groups'), 'No text - Groups'
- assert page.has_link?('Repositories'), 'No link - Repositories'
- assert page.has_link?('Virtual machines'), 'No link - Virtual machines'
- assert page.has_link?('SSH keys'), 'No link - SSH keys'
- assert page.has_link?('API tokens'), 'No link - API tokens'
- find('a', text: 'Users').click
- look_for_add_new = 'Add a new user'
- end
- else
- within('.dropdown-menu') do
- assert page.has_no_text?('Users'), 'Found text - Users'
- assert page.has_no_link?('Repositories'), 'Found link - Repositories'
- assert page.has_no_link?('Virtual machines'), 'Found link - Virtual machines'
- assert page.has_no_link?('SSH keys'), 'Found link - SSH keys'
- assert page.has_no_link?('API tokens'), 'Found link - API tokens'
-
- find('a', text: 'Groups').click
- look_for_add_new = 'Add a new group'
- end
+ within('.dropdown-menu') do
+ assert page.has_text?('Groups'), 'No text - Groups'
+ assert page.has_link?('Repositories'), 'No link - Repositories'
+ assert page.has_link?('Virtual machines'), 'No link - Virtual machines'
+ assert page.has_link?('SSH keys'), 'No link - SSH keys'
+ assert page.has_link?('API tokens'), 'No link - API tokens'
+ find('a', text: 'Users').click
end
end
- if look_for_add_new
- assert page.has_text? look_for_add_new
- end
+ assert page.has_text? 'Add a new user'
else
- assert page.has_no_link?('#system-menu'), 'Found link - system menu'
+ assert page.has_no_link?('system-menu'), 'Found link - system menu'
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list