[ARVADOS] updated: e1523c518fa4bf04ac4c982d0a5dbd681dea279a

git at public.curoverse.com git at public.curoverse.com
Wed Feb 4 21:35:10 EST 2015


Summary of changes:
 .../test/controllers/users_controller_test.rb       | 21 +++++++++++++++++++++
 .../test/integration/user_manage_account_test.rb    |  7 +++++++
 2 files changed, 28 insertions(+)

       via  e1523c518fa4bf04ac4c982d0a5dbd681dea279a (commit)
      from  9fc99919d72ee495e66ce98584189c651cf994c1 (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 e1523c518fa4bf04ac4c982d0a5dbd681dea279a
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Wed Feb 4 21:21:26 2015 -0500

    4951: add tests for request shell access feature.

diff --git a/apps/workbench/test/controllers/users_controller_test.rb b/apps/workbench/test/controllers/users_controller_test.rb
index 213a2a5..125d6b0 100644
--- a/apps/workbench/test/controllers/users_controller_test.rb
+++ b/apps/workbench/test/controllers/users_controller_test.rb
@@ -40,4 +40,25 @@ class UsersControllerTest < ActionController::TestCase
     assert_includes editables, true, "should have a writable repository"
     assert_includes editables, false, "should have a readonly repository"
   end
+
+  test "request shell access" do
+    user = api_fixture('users')['spectator']
+
+    post :request_shell_access, {
+      id: user['uuid'],
+      format: 'js'
+    }, session_for(:spectator)
+    assert_response :success
+
+    found_email = false
+    ActionMailer::Base.deliveries.andand.each do |email|
+      full_name = (user['first_name'] || "") + " " + (user['last_name'] || "")
+      expected = "Shell account request from #{full_name} (#{user['email']}, #{user['uuid']})"
+      if email.subject.include?(expected)
+        found_email = true
+        break
+      end
+    end
+    assert_equal true, found_email, "Expected email after requesting shell access"
+  end
 end
diff --git a/apps/workbench/test/integration/user_manage_account_test.rb b/apps/workbench/test/integration/user_manage_account_test.rb
index 28790b4..599a577 100644
--- a/apps/workbench/test/integration/user_manage_account_test.rb
+++ b/apps/workbench/test/integration/user_manage_account_test.rb
@@ -133,4 +133,11 @@ class UserManageAccountTest < ActionDispatch::IntegrationTest
       end
     end
   end
+
+  test "request shell access" do
+    visit page_with_token('spectator', '/manage_account')
+    assert_text 'You do not have access to any virtual machines'
+    click_button 'Request shell access'
+    assert_text 'Request sent for shell access'
+  end
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list