Skip to content
Snippets Groups Projects
Commit 85ec7674 authored by Taico Aerts's avatar Taico Aerts
Browse files

Add show tests

parent 0d6fc379
No related branches found
No related tags found
2 merge requests!51Upgrade to latest qpixel,!50Update to latest codidact changes
......@@ -31,5 +31,31 @@ class PostTest < ApplicationSystemTestCase
# TODO: Post validations
# TODO: Sort urls
# -------------------------------------------------------
# Show
# -------------------------------------------------------
test 'User can view post' 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
# Check that answers are displayed somewhere on the page
assert post.children.any?, 'The post for this system test should have answers'
post.children.where(deleted: false).each do |child|
assert_text child.body
end
end
test 'User can sort answers' do
post = posts(:question_one)
visit post_url(post)
click_on 'Active'
assert_current_path post_url(post, sort: 'active')
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment