Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #580 from binarylogic/require_hash_for_credentials
Remove support for ActionController::Parameters
- Loading branch information
Showing
4 changed files
with
67 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
require 'test_helper' | ||
|
||
# We forbid the use of AC::Parameters, and we have a test to that effect, but we | ||
# do not want a development dependency on `actionpack`, so we define it here. | ||
module ActionController | ||
class Parameters; end | ||
end | ||
|
||
module SessionTest | ||
class FoundationTest < ActiveSupport::TestCase | ||
def test_credentials_raise_if_not_a_hash | ||
session = UserSession.new | ||
e = assert_raises(TypeError) { | ||
session.credentials = ActionController::Parameters.new | ||
} | ||
assert_equal( | ||
::Authlogic::Session::Foundation::InstanceMethods::E_AC_PARAMETERS, | ||
e.message | ||
) | ||
end | ||
end | ||
end |