Sha256: b6f485b4e35949397a344ee0310152bc7f1a1f51fdb93636ae204dfffd7c7c4f

Contents?: true

Size: 529 Bytes

Versions: 5

Compression:

Stored size: 529 Bytes

Contents

require 'spec_helper'

describe Gutentag::Tagging do
  describe '#valid?' do
    let(:tag)      { Gutentag::Tag.create! :name => 'pancakes' }
    let(:taggable) { Article.create! }

    it "ensures tags are unique for any given taggable" do
      tagging = Gutentag::Tagging.new
      tagging.tag      = tag
      tagging.taggable = taggable
      tagging.save!

      tagging = Gutentag::Tagging.new
      tagging.tag      = tag
      tagging.taggable = taggable
      tagging.should have(1).error_on(:tag_id)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gutentag-0.5.0 spec/models/gutentag/tagging_spec.rb
gutentag-0.4.0 spec/models/gutentag/tagging_spec.rb
gutentag-0.3.0 spec/models/gutentag/tagging_spec.rb
gutentag-0.2.2 spec/models/gutentag/tagging_spec.rb
gutentag-0.2.1 spec/models/gutentag/tagging_spec.rb