[ARVADOS] updated: fefdb915c4cdf2c2d92061d9221eacd7cac4682f

git at public.curoverse.com git at public.curoverse.com
Wed Feb 4 09:24:00 EST 2015


Summary of changes:
 apps/workbench/config/application.default.yml         |  1 -
 .../test/controllers/projects_controller_test.rb      | 14 ++++++++++++++
 .../test/integration/anonymous_access_test.rb         | 19 -------------------
 apps/workbench/test/integration/errors_test.rb        |  6 ------
 4 files changed, 14 insertions(+), 26 deletions(-)

       via  fefdb915c4cdf2c2d92061d9221eacd7cac4682f (commit)
      from  de6150af4a477390eb8ba73c2f67c2c46c91a3ef (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 fefdb915c4cdf2c2d92061d9221eacd7cac4682f
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Wed Feb 4 09:22:05 2015 -0500

    2659: Do not turn on anonymous config by default in test mode; instead make the tests set it as needed.
    Also convert some of the simple integration tests into controller tests.

diff --git a/apps/workbench/config/application.default.yml b/apps/workbench/config/application.default.yml
index ab81032..f43e8c6 100644
--- a/apps/workbench/config/application.default.yml
+++ b/apps/workbench/config/application.default.yml
@@ -120,7 +120,6 @@ test:
         - Software developer
         - IT
         - Other
-  anonymous_user_token: 4kg6k6lzmp9kj4cpkcoxie964cmvjahbt4fod9zru44k4jqdmi
 
 common:
   assets.js_compressor: false
diff --git a/apps/workbench/test/controllers/projects_controller_test.rb b/apps/workbench/test/controllers/projects_controller_test.rb
index 5d7b1e2..c2089ad 100644
--- a/apps/workbench/test/controllers/projects_controller_test.rb
+++ b/apps/workbench/test/controllers/projects_controller_test.rb
@@ -207,4 +207,18 @@ class ProjectsControllerTest < ActionController::TestCase
                           }]
     get :show, encoded_params, session_for(:active)
   end
+
+  test "visit non-public project as anonymous when anonymous browsing is enabled and expect page not found" do
+    Rails.configuration.anonymous_user_token = api_fixture('api_client_authorizations')['anonymous']['api_token']
+    get(:show, {id: api_fixture('groups')['aproject']['uuid']})
+    assert_response 404
+    assert_includes @response.inspect, 'you are not logged in'
+  end
+
+  test "visit home page as anonymous when anonymous browsing is enabled and expect login" do
+    Rails.configuration.anonymous_user_token = api_fixture('api_client_authorizations')['anonymous']['api_token']
+    get(:index)
+    assert_response :redirect
+    assert_match /\/users\/welcome/, @response.redirect_url
+  end
 end
diff --git a/apps/workbench/test/integration/anonymous_access_test.rb b/apps/workbench/test/integration/anonymous_access_test.rb
index 0a85018..2e63662 100644
--- a/apps/workbench/test/integration/anonymous_access_test.rb
+++ b/apps/workbench/test/integration/anonymous_access_test.rb
@@ -52,19 +52,6 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
     end
   end
 
-  test "visit non-public project as anonymous when anonymous browsing is enabled and expect page not found" do
-    visit "/projects/#{api_fixture('groups')['aproject']['uuid']}"
-    assert_text 'Not Found'
-  end
-
-  test "anonymous user clicking on topnav sees login page" do
-    visit PUBLIC_PROJECT
-
-    # click on topnav
-    click_link 'workbench:test'
-    assert_text 'Please log in'
-  end
-
   test "selection actions when anonymous user accesses shared project" do
     visit PUBLIC_PROJECT
 
@@ -171,10 +158,4 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
     assert_text 'script version'
     assert_no_selector 'a', text: 'Run this pipeline'
   end
-
-  test "visit public project as anonymous when anonymous browsing is not enabled and expect login page" do
-    Rails.configuration.anonymous_user_token = false
-    visit "/projects/#{api_fixture('groups')['aproject']['uuid']}"
-    assert_text 'Please log in'
-  end
 end
diff --git a/apps/workbench/test/integration/errors_test.rb b/apps/workbench/test/integration/errors_test.rb
index 1cac667..1897a03 100644
--- a/apps/workbench/test/integration/errors_test.rb
+++ b/apps/workbench/test/integration/errors_test.rb
@@ -125,10 +125,4 @@ class ErrorsTest < ActionDispatch::IntegrationTest
       Rails.configuration.arvados_v1_base = original_arvados_v1_base
     end
   end
-
-  test "404 page checks if user not logged in and makes suggestion" do
-    visit "/collections/#{BAD_UUID}"
-    assert_text 'you are not logged in'
-  end
-
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list