mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 09:27:19 +02:00
23 lines
462 B
Ruby
23 lines
462 B
Ruby
require 'spec_helper'
|
|
|
|
RSpec.describe EmailValidator do
|
|
describe '#valid?' do
|
|
subject(:valid) { described_class.new(email).valid? }
|
|
|
|
context 'when email is valid' do
|
|
let(:email) { 'test@test.com' }
|
|
|
|
it 'returns truthy' do
|
|
expect(valid).to be_truthy
|
|
end
|
|
end
|
|
|
|
context 'when email is invalid' do
|
|
let(:email) { 'invalid' }
|
|
|
|
it 'returns falsey' do
|
|
expect(valid).to be_falsey
|
|
end
|
|
end
|
|
end
|
|
end
|