File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,7 +50,6 @@ class PinnedLinksControllerTest < ActionController::TestCase
5050 assert @links . any?
5151
5252 links_ids = pinned_links . map ( &:id )
53-
5453 assert ( @links . all? { |link | links_ids . include? ( link . id ) } )
5554
5655 get :index , params : { period : 'past' }
@@ -81,6 +80,17 @@ class PinnedLinksControllerTest < ActionController::TestCase
8180 end
8281 end
8382
83+ test ':index should treat invalid period filter as no filter' do
84+ sign_in users ( :moderator )
85+
86+ get :index , params : { period : 'invalid' }
87+ @links = assigns ( :links )
88+ assert_response ( :success )
89+
90+ links_ids = pinned_links . map ( &:id )
91+ assert ( @links . all? { |link | links_ids . include? ( link . id ) } )
92+ end
93+
8494 test 'only mods or higher should be able to see pinned links' do
8595 users . each do |user |
8696 sign_in user
You can’t perform that action at this time.
0 commit comments