}, session: session_for(:active)
assert_response :success
+ use_token :active
# verify no 'file1' in the updated collection
collection = Collection.select([:uuid, :manifest_text]).where(uuid: collection['uuid']).first
assert_not_includes(collection['manifest_text'], "0:0:file1")
assert_response :success
# verify that "./dir1" no longer exists in this collection's manifest text
+ use_token :active
collection = Collection.select([:uuid, :manifest_text]).where(uuid: collection['uuid']).first
assert_match /. d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:file1 0:0:file2\n$/, collection['manifest_text']
assert_not_includes(collection['manifest_text'], 'dir1')
}, session: session_for(:active)
assert_response :success
+ use_token :active
collection = Collection.select([:uuid, :manifest_text]).where(uuid: collection['uuid']).first
assert_match /. d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:file1renamed 0:0:file2\n.\/dir1 d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:dir1file1 0:0:dir1file2 0:0:dir1imagefile.png\n$/, collection['manifest_text']
}, session: session_for(:active)
assert_response :success
+ use_token :active
collection = Collection.select([:uuid, :manifest_text]).where(uuid: collection['uuid']).first
assert_match /. d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:file1renamed\n.\/dir1 d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:dir1file1 0:0:dir1file2 0:0:dir1imagefile.png 0:0:file2\n$/, collection['manifest_text']
}, session: session_for(:active)
assert_response :success
+ use_token :active
collection = Collection.select([:uuid, :manifest_text]).where(uuid: collection['uuid']).first
assert_match /. d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:file1renamed\n.\/dir1 d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:dir1file2 0:0:dir1imagefile.png 0:0:file2\n.\/dir2\/dir3 d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:dir1file1moved\n$/, collection['manifest_text']
}, session: session_for(:active)
assert_response :success
+ use_token :active
collection = Collection.select([:uuid, :manifest_text]).where(uuid: collection['uuid']).first
assert_match /. d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:file1renamed\n.\/dir1 d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:dir1file2 0:0:dir1imagefilerenamed.png 0:0:file2\n.\/dir2\/dir3 d41d8cd98f00b204e9800998ecf8427e\+0\+A(.*) 0:0:dir1file1moved\n$/, collection['manifest_text']
end
end
test "visit public projects page when anon config is not enabled as active user and expect 404" do
+ Rails.configuration.anonymous_user_token = nil
+ Rails.configuration.enable_public_projects_page = false
get :public, params: {}, session: session_for(:active)
assert_response 404
end
end
test "visit public projects page when anon config is not enabled as anonymous and expect login page" do
+ Rails.configuration.anonymous_user_token = nil
+ Rails.configuration.enable_public_projects_page = false
get :public
assert_response :redirect
assert_match /\/users\/welcome/, @response.redirect_url