Skip to content

Commit

Permalink
TRST-2676: fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aliyadeliveroo committed Nov 27, 2024
1 parent f403ca2 commit cde02fb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions spec/ravelin/event_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ class MyDummyClass < Ravelin::RavelinObject
authentication_mechanism: {
password: {
password: 'super-secret-password',
success: true
success: true,
emailPassword: '[email protected]',
}
}
}
Expand Down Expand Up @@ -237,7 +238,9 @@ class MyDummyClass < Ravelin::RavelinObject
'authenticationMechanism' => {
'password' => {
'passwordHashed' => '5c76fcf4400da3b4804d70b91af20703d483f2c5860cc2f8d59592a1da8d2121',
'success' => true
'success' => true,
'emailPasswordSHA256' => '60b980431585b5ec81dffba0dc11cf44b583d8925924af5f71d756404ef2e0a7',
'passwordSHA1SHA256' => '8f8db8a623009b56dc4ed8c47ede9d6a72d7569dcdfcedd6c1b7a3f441719f67',
}
},
'customerId' => '123',
Expand Down Expand Up @@ -268,6 +271,7 @@ class MyDummyClass < Ravelin::RavelinObject
authentication_mechanism: {
password: {
password: 'super-secret-password',
emailPassword: '[email protected]',
success: true
}
}
Expand Down Expand Up @@ -303,13 +307,16 @@ class MyDummyClass < Ravelin::RavelinObject
timestamp: 1586283630
).serializable_hash

puts output
expect(output).to eq(
{
"login" => {
"authenticationMechanism" => {
"password" => {
"passwordHashed" => "5c76fcf4400da3b4804d70b91af20703d483f2c5860cc2f8d59592a1da8d2121",
"success" => true
"success" => true,
'emailPasswordSHA256' => '60b980431585b5ec81dffba0dc11cf44b583d8925924af5f71d756404ef2e0a7',
'passwordSHA1SHA256' => '8f8db8a623009b56dc4ed8c47ede9d6a72d7569dcdfcedd6c1b7a3f441719f67',
}
},
"customerId" => "123",
Expand Down
4 changes: 2 additions & 2 deletions spec/ravelin/login_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
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'))) }
it { expect(subject.authentication_mechanism.password.emailPasswordSHA256).to eq('53437119eca797b8110d9299142f7b123aa011ef6676905ce30bbc887cec7efc') }
it { expect(subject.authentication_mechanism.password.passwordSHA1SHA256).to eq('539424f5201711772633efc0ccbaefa3e946e666bf4cc6a7a7ff0451826ba824') }
end

context 'creates an authentication_mechanism object' do
Expand Down

0 comments on commit cde02fb

Please sign in to comment.