+
+ get :show, {
+ id: test_collection[:uuid]
+ }
+ assert_response :success
+ assert_not_nil assigns(:object)
+ resp = JSON.parse(@response.body)
+ assert_equal test_collection[:uuid], resp['uuid']
+ assert_equal test_collection[:manifest_text], resp['manifest_text']
+ assert_equal 9, resp['data_size']
+ assert_equal [['.', 'foo.txt', 0],
+ ['.', 'bar.txt', 6],
+ ['./baz', 'bar.txt', 3]], resp['files']
+ end
+
+ test "list of files is correct for empty manifest" do
+ authorize_with :active
+ test_collection = {
+ manifest_text: "",
+ uuid: "d41d8cd98f00b204e9800998ecf8427e+0"
+ }
+ post :create, {
+ collection: test_collection
+ }
+ assert_response :success
+
+ get :show, {
+ id: "d41d8cd98f00b204e9800998ecf8427e+0"
+ }
+ assert_response :success
+ resp = JSON.parse(@response.body)
+ assert_equal [], resp['files']