mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
More testing info in README.
This commit is contained in:
parent
4f5789f8b1
commit
d9fbdff11b
1 changed files with 4 additions and 5 deletions
|
@ -223,9 +223,7 @@ Take a look at our locale file to check all available messages.
|
|||
|
||||
== Test helpers
|
||||
|
||||
Devise includes some tests helpers for functional specs. To use them, you just
|
||||
need to include Devise::TestHelpers in your test class and use the sign_in and
|
||||
sign_out method. Such methods have the same signature as in controllers:
|
||||
Devise includes some tests helpers for functional specs. To use them, you just need to include Devise::TestHelpers in your test class and use the sign_in and sign_out method. Such methods have the same signature as in controllers:
|
||||
|
||||
sign_in :user, @user # sign_in(scope, resource)
|
||||
sign_in @user # sign_in(resource)
|
||||
|
@ -233,13 +231,14 @@ sign_out method. Such methods have the same signature as in controllers:
|
|||
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 or spec/spec_helper.rb file:
|
||||
|
||||
class ActionController::TestCase
|
||||
include Devise::TestHelpers
|
||||
end
|
||||
|
||||
Do not use such helpers for integration tests like Cucumber, Webrat... Just fill in the form or explicitly set the user in session. For more tips, check the wiki (http://wiki.github.com/plataformatec/devise).
|
||||
|
||||
== Migrating from other solutions
|
||||
|
||||
Devise implements encryption strategies for Clearance, Authlogic and Restful-Authentication. To make use of it set the desired encryptor in the encryptor initializer config option. You might also need to rename your encrypted password and salt columns to match Devises's one (encrypted_password and password_salt).
|
||||
|
|
Loading…
Add table
Reference in a new issue