Skip to content

Commit e403bdd

Browse files
authored
Merge pull request #6671 from hexdevs/sb-fix-shoulda-matchers-warn-6670
Ensure CustomOrgLink#active tests inclusion in [true, false]
2 parents 928df03 + 357eca3 commit e403bdd

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

spec/models/custom_org_link_spec.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
it { is_expected.to validate_presence_of :text }
66
it { is_expected.to validate_presence_of :url }
77
it { is_expected.to validate_length_of(:text).is_at_most described_class::TEXT_MAX_LENGTH }
8-
it { is_expected.to validate_inclusion_of(:active).in_array [true, false] }
98

109
describe "#trim_name" do
1110
let(:casa_org) { create(:casa_org) }
@@ -27,4 +26,14 @@
2726
it { is_expected.not_to allow_value("example.com").for(:url) }
2827
it { is_expected.not_to allow_value("some arbitrary string").for(:url) }
2928
end
29+
30+
describe "#active" do
31+
it "only allows true or false" do
32+
casa_org = build(:casa_org)
33+
34+
expect(build(:custom_org_link, casa_org: casa_org, active: false)).to be_valid
35+
expect(build(:custom_org_link, casa_org: casa_org, active: true)).to be_valid
36+
expect(build(:custom_org_link, casa_org: casa_org, active: nil)).to be_invalid
37+
end
38+
end
3039
end

0 commit comments

Comments
 (0)