2013-08-23 17:35:01 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe DigestEmailSiteSetting do
|
|
|
|
describe 'valid_value?' do
|
|
|
|
it 'returns true for a valid value as an int' do
|
2014-09-25 11:44:48 -04:00
|
|
|
DigestEmailSiteSetting.valid_value?(1).should == true
|
2013-08-23 17:35:01 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns true for a valid value as a string' do
|
2014-09-25 11:44:48 -04:00
|
|
|
DigestEmailSiteSetting.valid_value?('1').should == true
|
2013-08-23 17:35:01 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns false for an invalid value' do
|
2014-09-25 11:44:48 -04:00
|
|
|
DigestEmailSiteSetting.valid_value?(1.5).should == false
|
|
|
|
DigestEmailSiteSetting.valid_value?('7 dogs').should == false
|
2013-08-23 17:35:01 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|