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

Fix creation tests

parent fdd19237
No related branches found
No related tags found
2 merge requests!51Upgrade to latest qpixel,!50Update to latest codidact changes
require 'application_system_test_case'
class PostTest < ApplicationSystemTestCase
# -------------------------------------------------------
# Create
# -------------------------------------------------------
test 'Not-signed in user cannot create a post' do
visit root_url
click_on 'Create Post'
......@@ -18,7 +22,11 @@ class PostTest < ApplicationSystemTestCase
'Does that actually work?'
fill_in 'Summarize your post with a title:', with: 'Can a signed-in user create a post?'
post_form_select_tag tags(:faq).name
click_on "Save Post in #{category.name}a"
# Check that the post is actually created
assert_difference 'Post.count' do
click_on "Save Post in #{category.name}"
end
end
# TODO: Post validations
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment