Permalink
Browse files

add request example group

  • Loading branch information...
1 parent eba85a3 commit a2e61070b4f432889750b9296d231e39dbe57d2f @dchelimsky dchelimsky committed Jan 8, 2010
Showing with 43 additions and 0 deletions.
  1. +43 −0 lib/rspec/rails/example/request_example_group.rb
View
43 lib/rspec/rails/example/request_example_group.rb
@@ -0,0 +1,43 @@
+RAILS_ENV = "test"
+require 'config/environment'
+require 'rspec'
+require 'action_controller'
+require 'action_controller/url_rewriter'
+require 'webrat'
+
+
+module RequestExampleGroupBehaviour
+ include ActionDispatch::Assertions
+ include ActionDispatch::Integration::Runner
+ include Webrat::Matchers
+ include Webrat::Methods
+ Rails.application.routes.install_helpers(self)
+
+ def app
+ Rails.application
+ end
+
+ Webrat.configure do |config|
+ config.mode = :rack
+ end
+
+ def last_response
+ response
+ end
+
+ Rspec::Core.configure do |c|
+ c.include self
+ # , :behaviour => { :describes => /^\// }
+ end
+end
+
+# describe "/widgets" do
+ # context "GET index" do
+ # it "does something" do
+ # visit widgets_path
+ # response.body.should == "this text"
+ # response.should contain("this text")
+ # response.should have_selector('p:contains("that")')
+ # end
+ # end
+# end

0 comments on commit a2e6107

Please sign in to comment.