OSDN Git Service

Add test serving uploaded apk
authoreagletmt <eagletmt@gmail.com>
Sat, 20 Oct 2012 05:14:53 +0000 (14:14 +0900)
committereagletmt <eagletmt@gmail.com>
Sat, 20 Oct 2012 05:14:53 +0000 (14:14 +0900)
CutenServer/test/functional/apks_controller_test.rb

index cdaf544..7cc3e87 100644 (file)
@@ -45,4 +45,12 @@ class ApksControllerTest < ActionController::TestCase
     @apk.store_file uploaded
     assert File.readable?(@apk.path)
   end
+
+  test "should download uploaded file" do
+    uploaded = fixture_file_upload 'dummy.apk', Apk::MIME_TYPE
+    @apk.store_file uploaded
+
+    get :download, :id => @apk
+    assert_equal uploaded.read, @response.body
+  end
 end