Created
June 28, 2022 04:07
-
-
Save itsmeurbi/30de5af9c03bb7171887caa7cb89492c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
class CommentsControllerTest < ActionDispatch::IntegrationTest | |
test '#create stores a comment for a given post' do | |
my_post = Post.create(title: 'My post', content: 'My new blog post') | |
post post_comments_path(my_post), params: { comment: { content: 'Nice post!' } } | |
assert_redirected_to post_path(my_post) | |
assert_equal 'Comment created!', flash[:notice] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment