Skip to content

Commit 3eae24a

Browse files
committed
Add test that logged out user can view question list
1 parent ee9e02a commit 3eae24a

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

test/system/post_system_test.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,21 @@ class PostSystemTest < ApplicationSystemTestCase
133133
end
134134
end
135135

136+
test 'Anyone can view questions in the list' do
137+
post=posts(:question_one)
138+
visit post_url(post)
139+
140+
# Check that the post is displayed somewhere on the page
141+
assert_text post.title
142+
assert_text post.body
143+
144+
# Navigate to the question list for this category
145+
click_on 'Posts'
146+
147+
# Check that there is at least one question listed
148+
assert_no_text '0 posts'
149+
end
150+
136151
test 'Anyone can sort answers' do
137152
post = posts(:question_one)
138153
visit post_url(post)

0 commit comments

Comments
 (0)