2013-02-05 14:16:51 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
require 'email'
|
|
|
|
|
|
|
|
describe Email do
|
|
|
|
|
|
|
|
|
|
|
|
it 'should treat a good email as valid' do
|
|
|
|
Email.is_valid?('sam@sam.com').should be_true
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'should treat a bad email as invalid' do
|
|
|
|
Email.is_valid?('sam@sam').should be_false
|
|
|
|
end
|
2013-02-25 11:42:20 -05:00
|
|
|
|
2013-02-05 14:16:51 -05:00
|
|
|
it 'should allow museum tld' do
|
|
|
|
Email.is_valid?('sam@nic.museum').should be_true
|
|
|
|
end
|
2013-02-25 11:42:20 -05:00
|
|
|
|
2013-02-05 14:16:51 -05:00
|
|
|
it 'should not think a word is an email' do
|
|
|
|
Email.is_valid?('sam').should be_false
|
|
|
|
end
|
|
|
|
end
|