Sha256: 323eb2f0f83c2a8f7bbef62005cdaac1bf16a18b4836480932f0294ef9f51280

Contents?: true

Size: 517 Bytes

Versions: 1

Compression:

Stored size: 517 Bytes

Contents

require "spec_helper"

describe Commentable do
  let(:user) { User.create }
  let(:project) { Project.create }

  it "injects association" do
    Project.new.should respond_to(:comments)
    Task.new.should respond_to(:comments)
  end

  it "skips association" do
    List.new.should_not respond_to(:comments)
  end

  it "adds new comment shortcut" do
    project.comments.should_receive(:create).with(:body => "Some comment", :user => user)
    project.add_comment(:body => "Some comment", :user => user)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
commentable-0.1.0 spec/commentable_spec.rb