end
end
- test 'get trashed collection with include_trash' do
- uuid = 'zzzzz-4zz18-mto52zx1s7sn3ih' # expired_collection
- authorize_with :active
- get :show, params: {
- id: uuid,
- include_trash: true,
- }
- assert_response 200
+ [true, false].each do |include_trash|
+ test "get trashed collection with include_trash=#{include_trash}" do
+ uuid = 'zzzzz-4zz18-mto52zx1s7sn3ih' # expired_collection
+ authorize_with :active
+ get :show, params: {
+ id: uuid,
+ include_trash: include_trash,
+ }
+ if include_trash
+ assert_response 200
+ else
+ assert_response 404
+ end
+ end
end
[:admin, :active].each do |user|
- test "get trashed collection via filters and #{user} user" do
+ test "get trashed collection via filters and #{user} user without including its past versions" do
uuid = 'zzzzz-4zz18-mto52zx1s7sn3ih' # expired_collection
authorize_with user
get :index, params: {
json_response['name']
end
+ test 'can get old version collection by PDH' do
+ authorize_with :active
+ get :show, params: {
+ id: collections(:collection_owned_by_active_past_version_1).portable_data_hash,
+ }
+ assert_response :success
+ assert_equal collections(:collection_owned_by_active_past_version_1).portable_data_hash,
+ json_response['portable_data_hash']
+ end
+
test 'version and current_version_uuid are ignored at creation time' do
permit_unsigned_manifests
authorize_with :active