mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
parent
e6e3ab9e1e
commit
ab77a1ae31
1 changed files with 23 additions and 0 deletions
23
spec/lib/validators/email_validator_spec.rb
Normal file
23
spec/lib/validators/email_validator_spec.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue