Sha256: 72b6cd8795eb7733094d1ca58b2556570527ab4988062ec5a5448e2efe5a8421
Contents?: true
Size: 1.04 KB
Versions: 11
Compression:
Stored size: 1.04 KB
Contents
require "test_helper" class CommentsControllerTest < ActionDispatch::IntegrationTest setup do @comment = comments(:one) end test "should get index" do get comments_url assert_response :success end test "should get new" do get new_comment_url assert_response :success end test "should create comment" do assert_difference('Comment.count') do post comments_url, params: { comment: { content: @comment.content } } end assert_redirected_to comment_url(Comment.last) end test "should show comment" do get comment_url(@comment) assert_response :success end test "should get edit" do get edit_comment_url(@comment) assert_response :success end test "should update comment" do patch comment_url(@comment), params: { comment: { content: @comment.content } } assert_redirected_to comment_url(@comment) end test "should destroy comment" do assert_difference('Comment.count', -1) do delete comment_url(@comment) end assert_redirected_to comments_url end end
Version data entries
11 entries across 11 versions & 1 rubygems