6604- Disabled SSH public key notification when shell_in_a_box_url
authorManoj <jonam33@gmail.com>
Thu, 16 Jul 2015 19:01:05 +0000 (15:01 -0400)
committerManoj <jonam33@gmail.com>
Thu, 16 Jul 2015 19:01:05 +0000 (15:01 -0400)
is configured.

apps/workbench/app/controllers/application_controller.rb
apps/workbench/test/integration/application_layout_test.rb

index db00be390a7e6846c2c8983efb90c2f213fd4336..db3d43040c416bef846a19d8ee0b4009a9e8f622 100644 (file)
@@ -707,6 +707,7 @@ class ApplicationController < ActionController::Base
   @@notification_tests = []
 
   @@notification_tests.push lambda { |controller, current_user|
+    return nil if Rails.configuration.shell_in_a_box_url
     AuthorizedKey.limit(1).where(authorized_user_uuid: current_user.uuid).each do
       return nil
     end
index daf2b09bbb1717b50bd472a54cda8e13a0e63db1..3a8717f8811f1b75d492fa5451e81551ae6fd3ca 100644 (file)
@@ -201,4 +201,12 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
       assert page.has_link?('Report a problem ...'), 'No link - Report a problem'
     end
   end
+
+  test "no SSH public key notification when shell_in_a_box_url is configured" do
+    Rails.configuration.shell_in_a_box_url = 'example.com'
+    visit page_with_token('job_reader')
+    click_link 'notifications-menu'
+    assert page.has_no_link?('Click here to set up an SSH public key for use with Arvados.')
+    assert page.has_link?('Click here to learn how to run an Arvados Crunch pipeline')
+  end
 end