Sha256: 8a7a75726ec497712c22166ca00b0bf8fb76bdc72b1d8a2acd3b0114aaf590c0

Contents?: true

Size: 1.31 KB

Versions: 11

Compression:

Stored size: 1.31 KB

Contents

require 'test_helper'

module Notee
  class CommentsControllerTest < ActionDispatch::IntegrationTest
    include Engine.routes.url_helpers

    setup do
      @comment = notee_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, email: @comment.email, name: @comment.name, post_id: @comment.post_id } }
      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, email: @comment.email, name: @comment.name, post_id: @comment.post_id } }
      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
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
notee-1.0.7 test/controllers/notee/comments_controller_test.rb
notee-1.0.6 test/controllers/notee/comments_controller_test.rb
notee-1.0.5 test/controllers/notee/comments_controller_test.rb
notee-1.0.4 test/controllers/notee/comments_controller_test.rb
notee-1.0.3 test/controllers/notee/comments_controller_test.rb
notee-1.0.2 test/controllers/notee/comments_controller_test.rb
notee-1.0.1 test/controllers/notee/comments_controller_test.rb
notee-1.0.0 test/controllers/notee/comments_controller_test.rb
notee-0.4.0 test/controllers/notee/comments_controller_test.rb
notee-0.3.7 test/controllers/notee/comments_controller_test.rb
notee-0.3.6 test/controllers/notee/comments_controller_test.rb