From 84d14d659b8c31c266a3b08e688171f90fe46cad Mon Sep 17 00:00:00 2001 From: Manoj Date: Fri, 14 Aug 2015 14:06:40 -0400 Subject: [PATCH] 6652: Add a new repository and add a new authorized key buttons no longer appear in the admin pages and tests have been updated. --- apps/workbench/app/models/authorized_key.rb | 2 +- apps/workbench/app/models/repository.rb | 2 +- .../test/integration/application_layout_test.rb | 16 ++++++++-------- apps/workbench/test/integration/errors_test.rb | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/workbench/app/models/authorized_key.rb b/apps/workbench/app/models/authorized_key.rb index d84adea44f..b0c2fa2f02 100644 --- a/apps/workbench/app/models/authorized_key.rb +++ b/apps/workbench/app/models/authorized_key.rb @@ -8,6 +8,6 @@ class AuthorizedKey < ArvadosBase end def self.creatable? - current_user + false end end diff --git a/apps/workbench/app/models/repository.rb b/apps/workbench/app/models/repository.rb index 1caab89cc7..7f9513a5a9 100644 --- a/apps/workbench/app/models/repository.rb +++ b/apps/workbench/app/models/repository.rb @@ -1,6 +1,6 @@ class Repository < ArvadosBase def self.creatable? - current_user and current_user.is_admin + false end def attributes_for_display super.reject { |x| x[0] == 'fetch_url' } diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb index a8932d76ce..429e811a8c 100644 --- a/apps/workbench/test/integration/application_layout_test.rb +++ b/apps/workbench/test/integration/application_layout_test.rb @@ -217,9 +217,9 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest end [ - ['Repositories','repository','Attributes'], + ['Repositories',nil,'s0uqq'], ['Virtual machines','virtual machine','current_user_logins'], - ['SSH keys','authorized key','public_key'], + ['SSH keys',nil,'public_key'], ['Links','link','link_class'], ['Groups','group','group_class'], ['Compute nodes','node','info[ping_secret'], @@ -227,8 +227,6 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest ['Keep disks', 'keep disk','bytes_free'], ].each do |page_name, add_button_text, look_for| test "test system menu #{page_name} link" do - skip 'Skip repositories test until #6652 is fixed.' if page_name == 'Repositories' - visit page_with_token('admin') within('.navbar-fixed-top') do page.find("#system-menu").click @@ -238,11 +236,13 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest end end - # click the add button - assert_selector 'button', text: "Add a new #{add_button_text}" - find('button', text: "Add a new #{add_button_text}").click + # click the add button if it exists + if add_button_text + assert_selector 'button', text: "Add a new #{add_button_text}" + find('button', text: "Add a new #{add_button_text}").click + end - # look for unique property in the created object page + # look for unique property in the current page assert page.has_text? look_for end end diff --git a/apps/workbench/test/integration/errors_test.rb b/apps/workbench/test/integration/errors_test.rb index 06e17d617f..f2067a92bf 100644 --- a/apps/workbench/test/integration/errors_test.rb +++ b/apps/workbench/test/integration/errors_test.rb @@ -51,10 +51,10 @@ class ErrorsTest < ActionDispatch::IntegrationTest # it has a too-limited token, these tests will need to be adjusted. test "API error page includes error token" do start_stamp = now_timestamp - visit(page_with_token("active_readonly", "/authorized_keys")) - click_on "Add a new authorized key" + visit(page_with_token("active_readonly", "/groups")) + click_on "Add a new group" assert(page.has_text?(/fiddlesticks/i), - "Not on an error page after making an SSH key out of scope") + "Not on an error page after making a group out of scope") assert(page_has_error_token?(start_stamp), "no error token on 404 page") end -- 2.30.2