diff --git a/test/system/post_test.rb b/test/system/post_test.rb index 9822b98ccf341e7669ad311a88adc534394f33ba..f67d4207c21506920f6694884116ee0380b03bf3 100644 --- a/test/system/post_test.rb +++ b/test/system/post_test.rb @@ -1,6 +1,10 @@ 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