2013-08-24 05:35:01 +08: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 23:44:48 +08:00
|
|
|
DigestEmailSiteSetting.valid_value?(1).should == true
|
2013-08-24 05:35:01 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns true for a valid value as a string' do
|
2014-09-25 23:44:48 +08:00
|
|
|
DigestEmailSiteSetting.valid_value?('1').should == true
|
2013-08-24 05:35:01 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns false for an invalid value' do
|
2014-09-25 23:44:48 +08:00
|
|
|
DigestEmailSiteSetting.valid_value?(1.5).should == false
|
|
|
|
DigestEmailSiteSetting.valid_value?('7 dogs').should == false
|
2013-08-24 05:35:01 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|