Skip to content

Commit

Permalink
Create password_hasher_spec.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Sep 20, 2024
1 parent 94e0b41 commit 988af03
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions global_business/business/spec/lib/password_hasher_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'rails_helper'

RSpec.describe PasswordHasher do
describe '#hash' do
it 'hashes the given password' do
password = 'hello world'
hashed_password = PasswordHasher.hash(password)
expect(hashed_password).not_to eq(password)
end
end

describe '#verify' do
it 'verifies the given password against the hashed password' do
password = 'hello world'
hashed_password = PasswordHasher.hash(password)
expect(PasswordHasher.verify(password, hashed_password)).to be_truthy
end
end
end

0 comments on commit 988af03

Please sign in to comment.