Skip to content

Commit

Permalink
Use before block for fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
vrajmohan committed Dec 20, 2024
1 parent 8897a7e commit 7d8fc14
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions spec/models/service_provider_identity_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,20 @@
end

context 'when an email address for sharing has been set' do
it 'returns the shared email' do
before do
identity.email_address = shared_email_address
end

it 'returns the shared email' do
expect(identity.email_address_for_sharing).to eq(shared_email_address)
end
end

context 'when an email address for sharing has not been set' do
it 'returns the last login email' do
before do
identity.email_address = nil
end
it 'returns the last login email' do
expect(identity.email_address_for_sharing).to eq(last_login_email_address)
end
end
Expand Down

0 comments on commit 7d8fc14

Please sign in to comment.