require 'rails_helper'
describe User do
let(:user_with_magmalabs_account) { User.create email:
'
[email protected]' }
let(:user_with_gmail_account) { User.create email: '
[email protected]' }
describe '.has_magmalabs_account?' do
it 'returns true when email ends with "@magmalabs.io"' do
expect(
user_with_magmalabs_account.has_magmalabs_account?
).to be true
end
it 'returns false when email ends with "other domain"' do
expect(
user_with_gmail_account.has_magmalabs_account?
).to be false
end
end
end