@@ -92,6 +92,8 @@ class Edition::ValidationTest < ActiveSupport::TestCase
9292 supporting_organisations : [ organisation1 ] ,
9393 )
9494 assert_not edition . valid?
95+ assert edition . errors [ :lead_organisation_ids ] . any?
96+ assert edition . errors [ :supporting_organisation_ids ] . any?
9597 end
9698
9799 test "should be invalid when it duplicates organisations via lead and supporting on save" do
@@ -104,6 +106,8 @@ class Edition::ValidationTest < ActiveSupport::TestCase
104106 edition . lead_organisations = [ organisation1 ]
105107 edition . supporting_organisations = [ organisation1 ]
106108 assert_not edition . valid?
109+ assert edition . errors [ :lead_organisation_ids ] . any?
110+ assert edition . errors [ :supporting_organisation_ids ] . any?
107111 end
108112
109113 test "should be invalid when it duplicates organisations via edition organisations directly on create" do
@@ -115,6 +119,8 @@ class Edition::ValidationTest < ActiveSupport::TestCase
115119 build ( :edition_organisation , organisation : organisation1 , lead : false ) ] ,
116120 )
117121 assert_not edition . valid?
122+ assert edition . errors [ :lead_organisation_ids ] . any?
123+ assert edition . errors [ :supporting_organisation_ids ] . any?
118124 end
119125
120126 test "should be invalid when it duplicates organisations via edition organisations directly on save" do
@@ -126,6 +132,8 @@ class Edition::ValidationTest < ActiveSupport::TestCase
126132 )
127133 edition . edition_organisations . build ( organisation : organisation1 , lead : false )
128134 assert_not edition . valid?
135+ assert edition . errors [ :lead_organisation_ids ] . any?
136+ assert edition . errors [ :supporting_organisation_ids ] . any?
129137 end
130138
131139 test "should be invalid when it duplicates support organisations on create" do
0 commit comments