Sha256: ec7b16468e162e92cca34a9bfbfd30220b90e7004463967c04453c66a5ffbdbb

Contents?: true

Size: 907 Bytes

Versions: 6

Compression:

Stored size: 907 Bytes

Contents

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

Expectations do
  expect Tagging do
    Tag.new.taggings.proxy_reflection.klass
  end

  expect Tag.new(:name => "duplicate").not.to.be.valid? do
    Tag.create!(:name => "duplicate")
  end

  expect Tag.new(:name => "not dup").to.be.valid? do
    Tag.create!(:name => "not dup", :kind => "something")
  end

  expect Tag.new.not.to.be.valid?
  expect String do
    t = Tag.new
    t.valid?
    t.errors[:name]
  end

  expect Tag.create!(:name => "iamawesome", :kind => "awesomestuff") do
    Tag.find_or_initialize_with_name_like_and_kind("iaMawesome", "awesomestuff")
  end

  expect true do
    Tag.create!(:name => "iamawesome", :kind => "stuff")
    Tag.find_or_initialize_with_name_like_and_kind("iaMawesome", "otherstuff").new_record?
  end

  expect Tag.create!(:kind => "language", :name => "french") do
    Tag.of_kind("language").first
  end
end

Version data entries

6 entries across 6 versions & 4 rubygems

Version Path
bdimcheff-is_taggable-0.1.0 test/tag_test.rb
bdimcheff-is_taggable-0.1.1 test/tag_test.rb
giraffesoft-is_taggable-0.1.0 test/tag_test.rb
edouard-is_taggable-0.1.3 test/tag_test.rb
edouard-is_taggable-0.1.1 test/tag_test.rb
is_taggable-0.1.0 test/tag_test.rb