Sha256: d36877461083367784934035bf0128a073dd73657fed5696b5e076353191d77e

Contents?: true

Size: 914 Bytes

Versions: 7

Compression:

Stored size: 914 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'

class Muck::CommentsControllerTest < ActionController::TestCase

  def setup
    @controller = Muck::CommentsController.new
    @request    = ActionController::TestRequest.new
    @response   = ActionController::TestResponse.new
  end

  context "delete comment" do
    setup do
      @comment = Factory(:comment)
    end
    should "delete comment" do
      assert_difference "Comment.count", -1 do
        delete :destroy, { :id => @comment.to_param, :format => 'json' }
        ensure_flash(/comment successfully removed/i)
      end
    end
  end

  context "create comment" do
    setup do
      @user = Factory(:user)
    end
    should " be able to create a comment" do
      assert_difference "Comment.count" do
        post :create, { :type => 'User', :id => @user.id, :format => 'json', :comment => { :body => 'test' } }
      end
    end
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
muck-comments-0.1.1 test/functional/comments_controller_test.rb
muck-comments-0.1.2 test/functional/comments_controller_test.rb
muck-comments-0.1.3 test/functional/comments_controller_test.rb
muck-comments-0.1.4 test/functional/comments_controller_test.rb
muck-comments-0.1.5 test/functional/comments_controller_test.rb
muck-comments-0.1.6 test/functional/comments_controller_test.rb
muck-comments-0.1.0 test/functional/comments_controller_test.rb