2019-04-29 20:27:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-27 22:27:38 -04:00
|
|
|
RSpec.describe DigestEmailSiteSetting do
|
2013-08-23 17:35:01 -04:00
|
|
|
describe 'valid_value?' do
|
|
|
|
it 'returns true for a valid value as an int' do
|
2016-03-02 15:26:27 -05:00
|
|
|
expect(DigestEmailSiteSetting.valid_value?(1440)).to eq true
|
2013-08-23 17:35:01 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns true for a valid value as a string' do
|
2016-03-02 15:26:27 -05:00
|
|
|
expect(DigestEmailSiteSetting.valid_value?('1440')).to eq true
|
2013-08-23 17:35:01 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns false for an invalid value' do
|
2014-12-31 09:55:03 -05:00
|
|
|
expect(DigestEmailSiteSetting.valid_value?('7 dogs')).to eq false
|
2013-08-23 17:35:01 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|