From 3184834d728e4a9e033d1d30d7a2b5db645ae47c Mon Sep 17 00:00:00 2001 From: Rodrigo Flores Date: Wed, 22 Jun 2011 21:26:32 -0300 Subject: [PATCH] Added tests for confirmable --- test/integration/confirmable_test.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/integration/confirmable_test.rb b/test/integration/confirmable_test.rb index 350cece7..b16e4cef 100644 --- a/test/integration/confirmable_test.rb +++ b/test/integration/confirmable_test.rb @@ -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? %(\n) + 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? %(\n) 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)