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
9599bb86
Commit
9599bb86
authored
Aug 4, 2023
by
Taico Aerts
Browse files
Options
Downloads
Patches
Plain Diff
Add better verification of post creation
parent
fc4081a8
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
+12
-3
12 additions, 3 deletions
test/system/post_test.rb
with
12 additions
and
3 deletions
test/system/post_test.rb
+
12
−
3
View file @
9599bb86
...
...
@@ -18,15 +18,24 @@ class PostTest < ApplicationSystemTestCase
visit
category_path
(
category
)
click_on
'Create Post'
fill_in
'Body'
,
with:
"When running QPixel, users are generally supposed to be able to create posts.
\n
"
\
body_text
=
"When running QPixel, users are generally supposed to be able to create posts.
"
\
'Does that actually work?'
fill_in
'Summarize your post with a title:'
,
with:
'Can a signed-in user create a post?'
title_text
=
'Can a signed-in user create a post?'
fill_in
'Body'
,
with:
body_text
fill_in
'Summarize your post with a title:'
,
with:
title_text
post_form_select_tag
tags
(
:faq
).
name
# Check that the post is actually created
assert_difference
'Post.count'
do
click_on
"Save Post in
#{
category
.
name
}
"
end
# Verify that the post is correctly created
new_post
=
Post
.
last
assert_equal
body_text
,
new_post
.
body_markdown
assert_equal
title_text
,
new_post
.
title
assert_equal
[
tags
(
:faq
)],
new_post
.
tags
end
test
'Creating a question is blocked when body is too short'
do
...
...
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