fixed upload tests

This commit is contained in:
albert
2011-08-23 18:33:27 -04:00
parent 4265408581
commit ebee1eb665
4 changed files with 5 additions and 3 deletions

View File

@@ -64,7 +64,9 @@ class UploadsControllerTest < ActionController::TestCase
context "create action" do
should "create a new upload" do
assert_difference("Upload.count", 1) do
post :create, {:upload => {:file => upload_jpeg("#{Rails.root}/test/files/test.jpg"), :tag_string => "aaa", :rating => "q", :source => "aaa"}}, {:user_id => @user.id}
file = Rack::Test::UploadedFile.new("#{Rails.root}/test/files/test.jpg", "image/jpeg")
file.stubs(:tempfile).returns(file)
post :create, {:upload => {:file => file, :tag_string => "aaa", :rating => "q", :source => "aaa"}}, {:user_id => @user.id}
end
end
end