Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
Qpixel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Answers
Qpixel
Commits
85ec7674
Commit
85ec7674
authored
Aug 2, 2023
by
Taico Aerts
Browse files
Options
Downloads
Patches
Plain Diff
Add show tests
parent
0d6fc379
No related branches found
No related tags found
2 merge requests
!51
Upgrade to latest qpixel
,
!50
Update to latest codidact changes
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/system/post_test.rb
+28
-2
28 additions, 2 deletions
test/system/post_test.rb
with
28 additions
and
2 deletions
test/system/post_test.rb
+
28
−
2
View file @
85ec7674
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment