Add test for Opera photo upload.

This commit is contained in:
John Edmonds 2011-09-25 11:35:24 -04:00
parent b999617dde
commit dcd7e936df

View file

@ -14,6 +14,18 @@ describe PhotosController do
request.env["HTTP_REFERER"] = '' request.env["HTTP_REFERER"] = ''
end end
describe '#create' do
before do
@params = {:photo => {:aspect_ids => "all"}, :qqfile => Rack::Test::UploadedFile.new("spec/fixtures/button.png", "image/png") }
end
it 'accepts a photo from a regular form submission' do
lambda {
post :create, @params
}.should change(Photo, :count).by(1)
end
end
describe '#create' do describe '#create' do
before do before do
@controller.stub!(:file_handler).and_return(uploaded_photo) @controller.stub!(:file_handler).and_return(uploaded_photo)