Skip to content

Commit

Permalink
Guard against params[:form] being nil
Browse files Browse the repository at this point in the history
Apparently this happens on 1.8.7.
http://travis-ci.org/#!/jnicklas/capybara/jobs/2181888/L69

This is perhaps Sinatra acting different under 1.8.7. I'm not sure what
exactly is going wrong, but it doesn't seem to be a bug in Capybara
(just the test suite).
  • Loading branch information
joliss authored and jnicklas committed Oct 7, 2012
1 parent c51cc13 commit 3ad709a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/capybara/spec/test_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class TestApp < Sinatra::Base
end

post '/upload_empty' do
if params[:form][:file].nil?
if params[:form].nil? || params[:form][:file].nil?
'Successfully ignored empty file field.'
else
'Something went wrong.'
Expand Down

0 comments on commit 3ad709a

Please sign in to comment.