[ARVADOS] updated: 0c3927322282606c3aa6e668641ec2b9e7f4d65e

git at public.curoverse.com git at public.curoverse.com
Tue Dec 2 08:17:43 EST 2014


Summary of changes:
 .../notifications/_ssh_key_notification.html.erb   | 16 +-------
 .../test/integration/user_manage_account_test.rb   | 46 +++++++++++++++++-----
 services/api/test/fixtures/users.yml               |  5 ++-
 3 files changed, 42 insertions(+), 25 deletions(-)

       via  0c3927322282606c3aa6e668641ec2b9e7f4d65e (commit)
      from  11bfce50c0ed1519d764ede1538bcfb72c244019 (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 0c3927322282606c3aa6e668641ec2b9e7f4d65e
Author: radhika <radhika at curoverse.com>
Date:   Tue Dec 2 08:16:47 2014 -0500

    4638: update ssh notification link to point to manage account page.

diff --git a/apps/workbench/app/views/notifications/_ssh_key_notification.html.erb b/apps/workbench/app/views/notifications/_ssh_key_notification.html.erb
index 1dedb4d..2a53b7f 100644
--- a/apps/workbench/app/views/notifications/_ssh_key_notification.html.erb
+++ b/apps/workbench/app/views/notifications/_ssh_key_notification.html.erb
@@ -2,19 +2,5 @@
     <div>
       Hi, I noticed that you have not yet set up an SSH public key for use with Arvados.  
       <%= link_to "Click here to learn about SSH keys in Arvados.",
-	  "#{Rails.configuration.arvados_docsite}/user/getting_started/ssh-access-unix.html", 
-	  style: "font-weight: bold",
-	  target: "_blank" %>
-      When you have an SSH key you would like to use, paste the SSH public key
-      in the text box.
+ 	    "/manage_account", style: "font-weight: bold" %>
     </div>
-    <%= form_for AuthorizedKey.new, remote: true do |f| %>
-      <div class="row-fluid">
-          <%= hidden_field_tag :return_to, request.original_url %>
-          <%= hidden_field_tag :disable_element, 'input[type=submit]' %>
-          <%= f.text_area :public_key, rows: 4, placeholder: "Paste your public key here", style: "width: 100%" %>
-      </div>
-      <div class="row-fluid" style="padding-top: 0; padding-bottom: 15px">
-          <%= f.submit :Save, value: raw("✓"), class: "btn btn-primary pull-right" %>
-      </div>
-<% end %>
diff --git a/apps/workbench/test/integration/user_manage_account_test.rb b/apps/workbench/test/integration/user_manage_account_test.rb
index ff2b7dd..a33c47e 100644
--- a/apps/workbench/test/integration/user_manage_account_test.rb
+++ b/apps/workbench/test/integration/user_manage_account_test.rb
@@ -24,9 +24,19 @@ class UserManageAccountTest < ActionDispatch::IntegrationTest
       assert page.has_text?('Repositories'), 'No text - Repositories'
       assert page.has_text?('SSH Keys'), 'No text - SSH Keys'
       assert page.has_text?('Current Token'), 'No text - Current Token'
-
       assert page.has_text?('The Arvados API token is a secret key that enables the Arvados SDKs to access Arvados'), 'No text - Arvados API token'
+      add_and_verify_ssh_key
+    else  # inactive user
+      within('.navbar-fixed-top') do
+        find('a', text: "#{user['email']}").click
+        within('.dropdown-menu') do
+          assert page.has_no_link?('Manage profile'), 'Found link - Manage profile'
+        end
+      end
+    end
+  end
 
+  def add_and_verify_ssh_key
       click_link 'Add new SSH key'
 
       within '.modal-content' do
@@ -52,14 +62,6 @@ class UserManageAccountTest < ActionDispatch::IntegrationTest
 
       # key must be added. look for it in the refreshed page
       assert page.has_text?('added_in_test'), 'No text - added_in_test'
-    else  # inactive user
-      within('.navbar-fixed-top') do
-        find('a', text: "#{user['email']}").click
-        within('.dropdown-menu') do
-          assert page.has_no_link?('Manage profile'), 'Found link - Manage profile'
-        end
-      end
-    end
   end
 
   [
@@ -73,4 +75,30 @@ class UserManageAccountTest < ActionDispatch::IntegrationTest
       verify_manage_account user
     end
   end
+
+  [
+    ['inactive_but_signed_user_agreement', true],
+    ['active', false],
+  ].each do |user, notifications|
+    test "test manage account for #{user} with notifications #{notifications}" do
+      visit page_with_token(user)
+      click_link 'notifications-menu'
+      if notifications
+        assert_selector('a', text: 'Click here to learn about SSH keys')
+        assert_selector('a', text: 'Click here to learn how to run an Arvados Crunch pipeline')
+        click_link('Click here to learn about SSH keys')
+        assert_selector('a', text: 'Add new SSH key')
+
+        add_and_verify_ssh_key
+
+        # No more SSH notification
+        click_link 'notifications-menu'
+        assert_no_selector('a', text: 'Click here to learn about SSH keys')
+        assert_selector('a', text: 'Click here to learn how to run an Arvados Crunch pipeline')
+      else
+        assert_no_selector('a', text: 'Click here to learn about SSH keys')
+        assert_no_selector('a', text: 'Click here to learn how to run an Arvados Crunch pipeline')
+      end
+    end
+  end
 end
diff --git a/services/api/test/fixtures/users.yml b/services/api/test/fixtures/users.yml
index c859f39..c04aa47 100644
--- a/services/api/test/fixtures/users.yml
+++ b/services/api/test/fixtures/users.yml
@@ -160,7 +160,10 @@ inactive_but_signed_user_agreement:
   identity_url: https://inactive-but-agreeable-user.openid.local
   is_active: false
   is_admin: false
-  prefs: {}
+  prefs:
+    profile:
+      organization: example.com
+      role: Computational biologist
 
 anonymous:
   owner_uuid: zzzzz-tpzed-000000000000000

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list