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,7 +5,8 @@ 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|
|
||||
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]
|
||||
|
@ -16,6 +17,9 @@ class SessionsControllerTest < ActionController::TestCase
|
|||
:password => "wrongpassword"
|
||||
}
|
||||
assert_equal 200, @response.status
|
||||
ensure
|
||||
ActiveSupport::Notifications.unsubscribe(subscriber)
|
||||
end
|
||||
end
|
||||
|
||||
test "#create works even with scoped views" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue