mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Remove subscriber block so it won't leak across the test suite.
This commit is contained in:
parent
49086d0294
commit
7b66133861
1 changed files with 14 additions and 10 deletions
|
@ -5,17 +5,21 @@ class SessionsControllerTest < ActionController::TestCase
|
|||
include Devise::TestHelpers
|
||||
|
||||
test "#create doesn't raise unpermitted params when sign in fails" do
|
||||
ActiveSupport::Notifications.subscribe /unpermitted_parameters/ do |name, start, finish, id, payload|
|
||||
flunk "Unpermitted params: #{payload}"
|
||||
begin
|
||||
subscriber = ActiveSupport::Notifications.subscribe /unpermitted_parameters/ do |name, start, finish, id, payload|
|
||||
flunk "Unpermitted params: #{payload}"
|
||||
end
|
||||
request.env["devise.mapping"] = Devise.mappings[:user]
|
||||
request.session["user_return_to"] = 'foo.bar'
|
||||
create_user
|
||||
post :create, :user => {
|
||||
:email => "wrong@email.com",
|
||||
:password => "wrongpassword"
|
||||
}
|
||||
assert_equal 200, @response.status
|
||||
ensure
|
||||
ActiveSupport::Notifications.unsubscribe(subscriber)
|
||||
end
|
||||
request.env["devise.mapping"] = Devise.mappings[:user]
|
||||
request.session["user_return_to"] = 'foo.bar'
|
||||
create_user
|
||||
post :create, :user => {
|
||||
:email => "wrong@email.com",
|
||||
:password => "wrongpassword"
|
||||
}
|
||||
assert_equal 200, @response.status
|
||||
end
|
||||
|
||||
test "#create works even with scoped views" do
|
||||
|
|
Loading…
Reference in a new issue