From 3eae24aeb43dcd16b0c9eb263303de9fe4b46115 Mon Sep 17 00:00:00 2001 From: trichoplax Date: Tue, 12 Aug 2025 17:14:36 +0100 Subject: [PATCH 1/2] Add test that logged out user can view question list --- test/system/post_system_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/system/post_system_test.rb b/test/system/post_system_test.rb index ddc6f31ed..9d88e4e3a 100644 --- a/test/system/post_system_test.rb +++ b/test/system/post_system_test.rb @@ -133,6 +133,21 @@ class PostSystemTest < ApplicationSystemTestCase end end + test 'Anyone can view questions in the list' do + post=posts(:question_one) + visit post_url(post) + + # Check that the post is displayed somewhere on the page + assert_text post.title + assert_text post.body + + # Navigate to the question list for this category + click_on 'Posts' + + # Check that there is at least one question listed + assert_no_text '0 posts' + end + test 'Anyone can sort answers' do post = posts(:question_one) visit post_url(post) From 731c55cff3263cd87d8e8443d7737322ee70c3e7 Mon Sep 17 00:00:00 2001 From: trichoplax Date: Tue, 12 Aug 2025 17:34:21 +0100 Subject: [PATCH 2/2] Add missing space around = for rubocop --- test/system/post_system_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/system/post_system_test.rb b/test/system/post_system_test.rb index 9d88e4e3a..83f29d62b 100644 --- a/test/system/post_system_test.rb +++ b/test/system/post_system_test.rb @@ -134,7 +134,7 @@ class PostSystemTest < ApplicationSystemTestCase end test 'Anyone can view questions in the list' do - post=posts(:question_one) + post = posts(:question_one) visit post_url(post) # Check that the post is displayed somewhere on the page