File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 ) }
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
3039end
You can’t perform that action at this time.
0 commit comments