3400: ArvadosResourceList retains api token that is active when it is created.
[arvados.git] / apps / workbench / test / functional / actions_controller_test.rb
index d152a003a157cdba9e35bd8c4592c3a3163e0cce..0e28b064e1e336cd6e6a3379da63982086f63e1e 100644 (file)
@@ -26,16 +26,12 @@ class ActionsControllerTest < ActionController::TestCase
          session_for(:active))
 
     assert_response 302   # collection created and redirected to new collection page
-    new_collection_uuid = response.headers['Location'].split('/')[-1]
-
-    @controller = CollectionsController.new
 
-    get :show, {
-      id: new_collection_uuid
-    }
-    assert_response :success
+    assert response.headers['Location'].include? '/collections/'
+    new_collection_uuid = response.headers['Location'].split('/')[-1]
 
-    collection = assigns(:object)
+    use_token :active
+    collection = Collection.select([:uuid, :manifest_text]).where(uuid: new_collection_uuid).first
     manifest_text = collection['manifest_text']
     assert manifest_text.include?('foo'), 'Not found foo in new collection manifest text'
     assert manifest_text.include?('bar'), 'Not found bar in new collection manifest text'