Permalink
Browse files

Expanding on testing docs a little to be more useful for those using …

…RSpec. ActionController::TestCase doesn't seem to be used in RSpec 2 - and besides, we want the setup method called so Warden is automatically initialised.
  • Loading branch information...
1 parent 2308361 commit 2d67432c2306eebb8dfcf7a100ec750e11082345 @pat pat committed with josevalim Jul 27, 2010
Showing with 7 additions and 1 deletion.
  1. +7 −1 README.rdoc
View
@@ -255,12 +255,18 @@ Devise includes some tests helpers for functional specs. To use them, you just n
sign_out :user # sign_out(scope)
sign_out @user # sign_out(resource)
-You can include the Devise Test Helpers in all of your tests by adding the following to the bottom of your test/test_helper.rb or spec/spec_helper.rb file:
+You can include the Devise Test Helpers in all of your tests by adding the following to the bottom of your test/test_helper.rb file:
class ActionController::TestCase
include Devise::TestHelpers
end
+If you're using RSpec and want the helpers automatically included within all `describe` blocks, add a file called spec/support/devise.rb with the following contents:
+
+ RSpec.configure do |config|
+ config.include Devise::TestHelpers
+ end
+
Do not use such helpers for integration tests such as Cucumber or Webrat. Instead, fill in the form or explicitly set the user in session. For more tips, check the wiki (http://wiki.github.com/plataformatec/devise).
== OAuth2

0 comments on commit 2d67432

Please sign in to comment.