-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It is the tickets content but more precisely its an Authentication Record. Now auth.expired? and auth.service make a lot more sense than before.
- Loading branch information
Showing
5 changed files
with
40 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module RbSSO | ||
class Content | ||
class Authentication | ||
VERSION = 3 | ||
|
||
class VersionMismatch < ArgumentError | ||
|
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require 'test_helper' | ||
require 'rbsso/authentication' | ||
|
||
class RbSSO::AuthenticationTest < Minitest::Test | ||
|
||
def test_basic_attributes | ||
assert_equal 'user', auth.user | ||
assert_equal 'service', auth.service | ||
assert_equal 'domain', auth.domain | ||
end | ||
|
||
def test_to_s | ||
assert_match /^3|user|service|domain|\d*|$/, auth.to_s | ||
end | ||
|
||
def test_parse | ||
parsed = RbSSO::Authentication.parse auth.to_s | ||
assert_equal auth, parsed | ||
end | ||
|
||
def test_invalid_version | ||
assert_raises RbSSO::Authentication::VersionMismatch do | ||
RbSSO::Authentication.parse '4|other versions may contain other auth' | ||
end | ||
end | ||
|
||
def auth | ||
RbSSO::Authentication.new user: 'user', | ||
service: 'service', | ||
domain: 'domain' | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.