Whitespace cleanup.
This commit is contained in:
parent
f1d669a024
commit
02fa065571
1 changed files with 7 additions and 7 deletions
|
|
@ -13,23 +13,23 @@ describe PhotosController do
|
||||||
sign_in :user, alice
|
sign_in :user, alice
|
||||||
request.env["HTTP_REFERER"] = ''
|
request.env["HTTP_REFERER"] = ''
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#create' do
|
describe '#create' do
|
||||||
before do
|
before do
|
||||||
@params = {:photo => {:aspect_ids => "all"}, :qqfile => Rack::Test::UploadedFile.new("spec/fixtures/button.png", "image/png") }
|
@params = {:photo => {:aspect_ids => "all"}, :qqfile => Rack::Test::UploadedFile.new("spec/fixtures/button.png", "image/png") }
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'accepts a photo from a regular form submission' do
|
it 'accepts a photo from a regular form submission' do
|
||||||
lambda {
|
lambda {
|
||||||
post :create, @params
|
post :create, @params
|
||||||
}.should change(Photo, :count).by(1)
|
}.should change(Photo, :count).by(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns application/json when possible' do
|
it 'returns application/json when possible' do
|
||||||
request.env['HTTP_ACCEPT'] = 'application/json'
|
request.env['HTTP_ACCEPT'] = 'application/json'
|
||||||
post(:create, @params).headers['Content-Type'].should match 'application/json.*'
|
post(:create, @params).headers['Content-Type'].should match 'application/json.*'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns text/html by default' do
|
it 'returns text/html by default' do
|
||||||
request.env['HTTP_ACCEPT'] = 'text/html,*/*'
|
request.env['HTTP_ACCEPT'] = 'text/html,*/*'
|
||||||
post(:create, @params).headers['Content-Type'].should match 'text/html.*'
|
post(:create, @params).headers['Content-Type'].should match 'text/html.*'
|
||||||
|
|
@ -59,10 +59,10 @@ describe PhotosController do
|
||||||
describe '#index' do
|
describe '#index' do
|
||||||
it "succeeds without any available pictures" do
|
it "succeeds without any available pictures" do
|
||||||
get :index, :person_id => Factory(:person).id.to_s
|
get :index, :person_id => Factory(:person).id.to_s
|
||||||
|
|
||||||
response.should be_success
|
response.should be_success
|
||||||
end
|
end
|
||||||
|
|
||||||
it "displays the logged in user's pictures" do
|
it "displays the logged in user's pictures" do
|
||||||
get :index, :person_id => alice.person.id.to_s
|
get :index, :person_id => alice.person.id.to_s
|
||||||
assigns[:person].should == alice.person
|
assigns[:person].should == alice.person
|
||||||
|
|
@ -161,7 +161,7 @@ describe PhotosController do
|
||||||
it "succeeds" do
|
it "succeeds" do
|
||||||
response.should be_success
|
response.should be_success
|
||||||
end
|
end
|
||||||
|
|
||||||
it "assigns the photo" do
|
it "assigns the photo" do
|
||||||
assigns[:photo].should == @photo
|
assigns[:photo].should == @photo
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue