Permalink
Browse files

Make Rack::Test methods available when using Capybara. Relates to GH-26

  • Loading branch information...
1 parent f95cb1c commit e79bd3c805d5fa181c18db9d72fdefb26b11595b @cavalle committed Nov 21, 2010
@@ -13,7 +13,7 @@ module Steak::Webrat
include Webrat::Matchers
def app
- Rails.application
+ ::Rails.application
end
end
@@ -22,7 +22,16 @@ def app
<%- else -%>
require 'capybara/rails'
-RSpec.configuration.include Capybara, :type => :acceptance
+module Steak::Capybara
+ include Rack::Test::Methods
+ include Capybara
+
+ def app
+ ::Rails.application
+ end
+end
+
+RSpec.configuration.include Steak::Capybara, :type => :acceptance
<%- end -%>
# Put your acceptance spec helpers inside /spec/acceptance/support
@@ -30,12 +30,12 @@
feature "Minimal spec" do
scenario "First scenario" do
get "/"
- response.should contain(/No route matches/)
+ last_response.body.should =~ /Not Found/
end
end
SPEC
output = run_spec spec_file, File.join(File.dirname(spec_file), '../..')
- output.should =~ /1 example, 1 failure/
+ output.should =~ /1 example, 0 failures/
end
scenario "Path helpers are available" do

0 comments on commit e79bd3c

Please sign in to comment.