-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TRST-2676: added emailPasswordSHA256 and passwordSHA1SHA256
- Loading branch information
1 parent
8084e30
commit f403ca2
Showing
2 changed files
with
16 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
require 'spec_helper' | ||
require 'digest' | ||
|
||
describe Ravelin::Login do | ||
subject do | ||
|
@@ -10,7 +11,8 @@ | |
authentication_mechanism: { | ||
password: { | ||
password: "lol", | ||
success: true | ||
success: true, | ||
emailPassword: "[email protected]", | ||
} | ||
}, | ||
custom: { | ||
|
@@ -22,6 +24,9 @@ | |
|
||
context 'creates instance with valid params' do | ||
it { expect { subject }.to_not raise_exception } | ||
|
||
it { expect(subject.authentication_mechanism.password.emailPasswordSHA256).to eq(Digest::SHA256.hexdigest("[email protected]")) } | ||
it { expect(subject.authentication_mechanism.password.passwordSHA1SHA256).to eq(Digest::SHA256.hexdigest(Digest::SHA1.hexdigest('lol'))) } | ||
end | ||
|
||
context 'creates an authentication_mechanism object' do | ||
|