@@ -678,38 +678,6 @@ class EditionTest < ActiveSupport::TestCase
678678 assert_equal "First published date must be between 1/1/1900 and the present" , edition . errors . full_messages . first
679679 end
680680
681- test "first_published_at cannot be after the date of the first change note" do
682- edition_with_change_note = create ( :edition_with_document , :published , change_note : "changed" , major_change_published_at : 2 . days . ago )
683- edition = build ( :edition , document : edition_with_change_note . document , first_published_at : 1 . day . ago )
684-
685- assert edition . invalid?
686- assert_equal "First published date must be before the first change note (09/11/2011 11:11)" , edition . errors . full_messages . first
687- end
688-
689- test "first_published_at cannot be before the start of the current government" do
690- create ( :current_government )
691- edition = build ( :edition , first_published_at : 10 . years . ago )
692-
693- assert edition . invalid?
694- assert_equal "First published date must be after the start of the current government (11/11/2009)" , edition . errors . full_messages . first
695- end
696-
697- test "polictial editions can have their first_published_at date set before the current government " do
698- create ( :current_government )
699- political_edition = create ( :edition , political : true , first_published_at : 10 . years . ago )
700-
701- assert political_edition . valid?
702- end
703-
704- test "after_change_notes' error message takes priority if multiple validation errors on first_published_at" do
705- edition_with_change_note = create ( :edition_with_document , :published , change_note : "changed" , major_change_published_at : 2 . days . ago )
706- edition = build ( :edition , document : edition_with_change_note . document , first_published_at : 10 . years . from_now )
707- edition . validate
708-
709- assert_equal 1 , edition . errors . size
710- assert_equal "First published date must be before the first change note (09/11/2011 11:11)" , edition . errors . full_messages . first
711- end
712-
713681 test "#government returns the associated government when the edition has a specific government_id" do
714682 create ( :current_government )
715683 previous_government = create ( :previous_government )
@@ -738,7 +706,7 @@ class EditionTest < ActiveSupport::TestCase
738706 test "#government returns the historic government for a previously published edition" do
739707 previous_government = create ( :previous_government )
740708 create ( :current_government )
741- edition = build ( :edition , first_published_at : 4 . years . ago )
709+ edition = create ( :edition , first_published_at : 4 . years . ago )
742710 assert_equal previous_government , edition . government
743711 end
744712
@@ -760,7 +728,7 @@ class EditionTest < ActiveSupport::TestCase
760728
761729 previous_government = create ( :previous_government )
762730
763- edition = build ( :edition , political : false , first_published_at : previous_government . start_date )
731+ edition = create ( :edition , political : false , first_published_at : previous_government . start_date )
764732 assert_not edition . historic?
765733
766734 edition = create ( :edition , political : false , first_published_at : current_government . start_date )
@@ -1014,12 +982,6 @@ class EditionTest < ActiveSupport::TestCase
1014982 assert_not edition . valid?
1015983 end
1016984
1017- test "#other_editions returns an empty array if there is no associated document" do
1018- edition = build ( :edition )
1019-
1020- assert_equal edition . other_editions , [ ]
1021- end
1022-
1023985 def decoded_token_payload ( token )
1024986 payload , _header = JWT . decode (
1025987 token ,
0 commit comments