mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Added tests for confirmable
This commit is contained in:
parent
8ef5534d92
commit
3184834d72
1 changed files with 9 additions and 1 deletions
|
@ -106,7 +106,7 @@ class ConfirmationTest < ActionController::IntegrationTest
|
|||
user = create_user(:confirm => false)
|
||||
post user_confirmation_path(:format => 'xml'), :user => { :email => user.email }
|
||||
assert_response :success
|
||||
assert response.body.include? %(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<user>)
|
||||
assert_equal response.body, {}.to_xml
|
||||
end
|
||||
|
||||
test 'resent confirmation token with invalid E-Mail in XML format should return invalid response' do
|
||||
|
@ -130,6 +130,14 @@ class ConfirmationTest < ActionController::IntegrationTest
|
|||
assert response.body.include? %(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<errors>)
|
||||
end
|
||||
|
||||
test 'request an account confirmation account with JSON, should return an empty JSON' do
|
||||
user = create_user(:confirm => false)
|
||||
|
||||
post user_confirmation_path, :user => { :email => user.email }, :format => :json
|
||||
assert_response :success
|
||||
assert_equal response.body, {}.to_json
|
||||
end
|
||||
|
||||
test "when in paranoid mode and with a valid e-mail, should not say that the e-mail is valid" do
|
||||
swap Devise, :paranoid => true do
|
||||
user = create_user(:confirm => false)
|
||||
|
|
Loading…
Reference in a new issue