Merge branch '16265-security-updates' into dependabot/bundler/apps/workbench/loofah...
[arvados.git] / apps / workbench / test / controllers / container_requests_controller_test.rb
index 261169cd1f954c352aaba6e58e577c9d0a955b4d..140b59fa5e7d0d2c923d974a3537ff501e0647af 100644 (file)
@@ -12,12 +12,12 @@ class ContainerRequestsControllerTest < ActionController::TestCase
     container_uuid = cr['container_uuid']
     container = Container.find(container_uuid)
 
-    get :show, {id: cr['uuid'], tab_pane: 'Log'}, session_for(:active)
+    get :show, params: {id: cr['uuid'], tab_pane: 'Log'}, session: session_for(:active)
     assert_response :success
 
     assert_select "a", {:href=>"/collections/#{container['log']}", :text=>"Download the log"}
     assert_select "a", {:href=>"#{container['log']}/baz"}
-    assert_not_includes @response.body, '<div id="event_log_div"'
+    assert_not_includes @response.body, '<pre id="event_log_div"'
   end
 
   test "visit running container request log tab" do
@@ -27,10 +27,10 @@ class ContainerRequestsControllerTest < ActionController::TestCase
     container_uuid = cr['container_uuid']
     container = Container.find(container_uuid)
 
-    get :show, {id: cr['uuid'], tab_pane: 'Log'}, session_for(:active)
+    get :show, params: {id: cr['uuid'], tab_pane: 'Log'}, session: session_for(:active)
     assert_response :success
 
-    assert_includes @response.body, '<div id="event_log_div"'
+    assert_includes @response.body, '<pre id="event_log_div"'
     assert_select 'Download the log', false
   end
 
@@ -39,7 +39,7 @@ class ContainerRequestsControllerTest < ActionController::TestCase
 
     uuid = api_fixture('container_requests')['completed']['uuid']
 
-    get :show, {id: uuid}, session_for(:active)
+    get :show, params: {id: uuid}, session: session_for(:active)
     assert_response :success
 
     assert_includes @response.body, "action=\"/container_requests/#{uuid}/copy\""
@@ -47,7 +47,7 @@ class ContainerRequestsControllerTest < ActionController::TestCase
 
   test "cancel request for queued container" do
     cr_fixture = api_fixture('container_requests')['queued']
-    post :cancel, {id: cr_fixture['uuid']}, session_for(:active)
+    post :cancel, params: {id: cr_fixture['uuid']}, session: session_for(:active)
     assert_response 302
 
     use_token 'active'
@@ -72,13 +72,12 @@ class ContainerRequestsControllerTest < ActionController::TestCase
       if reuse_enabled
         copy_params.merge!({use_existing: true})
       end
-      post(:copy, copy_params, session_for(:active))
+      post(:copy, params: copy_params, session: session_for(:active))
       assert_response 302
       copied_cr = assigns(:object)
       assert_not_nil copied_cr
       assert_equal 'Uncommitted', copied_cr[:state]
       assert_equal "Copy of #{completed_cr['name']}", copied_cr['name']
-      assert_equal completed_cr['cmd'], copied_cr['cmd']
       assert_equal completed_cr['runtime_constraints']['ram'], copied_cr['runtime_constraints'][:ram]
       if reuse_enabled
         assert copied_cr[:use_existing]
@@ -114,8 +113,8 @@ class ContainerRequestsControllerTest < ActionController::TestCase
       cr = api_fixture('container_requests')[cr_fixture]
       assert_not_nil cr
       get(:show,
-          {id: cr['uuid']},
-          session_for(:active))
+          params: {id: cr['uuid']},
+          session: session_for(:active))
       assert_response :success
       if should_show
         assert_includes @response.body, "href=\"#Provenance\""
@@ -130,13 +129,15 @@ class ContainerRequestsControllerTest < ActionController::TestCase
 
     cr = api_fixture('container_requests')['completed_with_input_mounts']
 
-    get :show, {id: cr['uuid']}, session_for(:active)
+    get :show, params: {id: cr['uuid']}, session: session_for(:active)
     assert_response :success
 
     assert_match /hello/, @response.body
+    assert_includes @response.body, "href=\"\/collections/fa7aeb5140e2848d39b416daeef4ffc5+45/baz\?" # locator on command
+    assert_includes @response.body, "href=\"\/collections/fa7aeb5140e2848d39b416daeef4ffc5+45/foobar\?" # locator on command
     assert_includes @response.body, "href=\"\/collections/fa7aeb5140e2848d39b416daeef4ffc5+45/foo" # mount input1
     assert_includes @response.body, "href=\"\/collections/fa7aeb5140e2848d39b416daeef4ffc5+45/bar" # mount input2
-    assert_includes @response.body, "href=\"\/collections/1fd08fc162a5c6413070a8bd0bffc818+150" # mount workflow
+    assert_includes @response.body, "href=\"\/collections/f9ddda46bb293b6847da984e3aa735db+290" # mount workflow
     assert_includes @response.body, "href=\"#Log\""
     assert_includes @response.body, "href=\"#Provenance\""
   end