2019-04-30 08:27:42 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-28 10:27:38 +08:00
|
|
|
RSpec.describe DigestEmailSiteSetting do
|
2023-01-09 19:18:21 +08:00
|
|
|
describe "valid_value?" do
|
|
|
|
it "returns true for a valid value as an int" do
|
2016-03-03 04:26:27 +08:00
|
|
|
expect(DigestEmailSiteSetting.valid_value?(1440)).to eq true
|
2013-08-24 05:35:01 +08:00
|
|
|
end
|
|
|
|
|
2023-01-09 19:18:21 +08:00
|
|
|
it "returns true for a valid value as a string" do
|
|
|
|
expect(DigestEmailSiteSetting.valid_value?("1440")).to eq true
|
2013-08-24 05:35:01 +08:00
|
|
|
end
|
|
|
|
|
2023-01-09 19:18:21 +08:00
|
|
|
it "returns false for an invalid value" do
|
|
|
|
expect(DigestEmailSiteSetting.valid_value?("7 dogs")).to eq false
|
2013-08-24 05:35:01 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|