2015-10-11 17:41:23 +08:00
|
|
|
require 'rails_helper'
|
2013-08-24 05:35:01 +08:00
|
|
|
|
|
|
|
describe DigestEmailSiteSetting do
|
|
|
|
describe 'valid_value?' do
|
|
|
|
it 'returns true for a valid value as an int' do
|
2014-12-31 22:55:03 +08:00
|
|
|
expect(DigestEmailSiteSetting.valid_value?(1)).to eq true
|
2013-08-24 05:35:01 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns true for a valid value as a string' do
|
2014-12-31 22:55:03 +08:00
|
|
|
expect(DigestEmailSiteSetting.valid_value?('1')).to eq true
|
2013-08-24 05:35:01 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns false for an invalid value' do
|
2014-12-31 22:55:03 +08:00
|
|
|
expect(DigestEmailSiteSetting.valid_value?('7 dogs')).to eq false
|
2013-08-24 05:35:01 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|