Sha256: 9a9e5f7bda55f22552e11ae1fe27911b776644b36341132df834939e966aefb1

Contents?: true

Size: 494 Bytes

Versions: 5

Compression:

Stored size: 494 Bytes

Contents

require 'spec_helper'

# class Comment < ActiveRecord::Base
#   belongs_to :post
#   has_slug   :title, :scope => :post_id
# end

describe Comment do
  it "should honor scope" do
    p1 = Post.create(:slug => 'hello-world')
    p2 = Post.create(:slug => 'hello-world')
    c1 = Comment.create(:post => p1, :slug => 'first-comment')
    Comment.create(:post => p2, :slug => 'first-comment').should be_valid
    Comment.create(:post => p1, :slug => 'first-comment').should_not be_valid
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
slugger-0.5.0 spec/lib/comment_spec.rb
slugger-0.4.1 spec/lib/comment_spec.rb
slugger-0.4.0 spec/lib/comment_spec.rb
slugger-0.3.2 spec/lib/comment_spec.rb
slugger-0.3.1 spec/lib/comment_spec.rb