Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ff49e988dc
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 72 lines (69 sloc) 2.492 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
require File.dirname(__FILE__) + '/../spec_helper'

describe Sequel::Plugins::Taggable do
  before do
    @example = ExampleModel.new
  end
  
  it "should add a .has_tags method to models which include DataMapper::Resource" do
    ExampleModel.should respond_to(:has_tags)
    # AnotherTaggedModel.should respond_to(:has_tags)
    # DefaultTaggedModel.should respond_to(:has_tags)
    # UntaggedModel.should respond_to(:has_tags)
  end
  #
  # it "should add a .has_tags_on method to models which include DataMapper::Resource" do
  # TaggedModel.should respond_to(:has_tags_on)
  # AnotherTaggedModel.should respond_to(:has_tags_on)
  # DefaultTaggedModel.should respond_to(:has_tags_on)
  # UntaggedModel.should respond_to(:has_tags_on)
  # end
  #
  # describe ".has_tags_on" do
  # it "should accept an array of context names" do
  # class HasTagsOnTestModel
  # include DataMapper::Resource
  # property :id, Integer, :serial => true
  # end
  # lambda{HasTagsOnTestModel.has_tags_on(:should, 'not', :raise)}.should_not raise_error(ArgumentError)
  # end
  #
  # it "should create taggable functionality for each of the context names passed" do
  # class TestModel
  # include DataMapper::Resource
  # property :id, Integer, :serial => true
  #
  # has_tags_on(:pets, 'skills', :tags)
  # end
  # TestModel.should be_taggable
  # a = TestModel.new
  # a.should be_taggable
  # a.should respond_to(:pet_list)
  # a.should respond_to(:skill_list)
  # a.should respond_to(:tag_list)
  # a.should respond_to(:pet_list=)
  # a.should respond_to(:skill_list=)
  # a.should respond_to(:tag_list=)
  # end
  # end
  #
  # describe ".has_tags" do
  # it "should create a taggable with 'tags' context regardless of passed arguments" do
  # class TagsOnly
  # include DataMapper::Resource
  # property :id, Integer, :serial => true
  # has_tags :pets, :skills
  # end
  # TagsOnly.should be_taggable
  # TagsOnly.new.should be_taggable
  # a = TagsOnly.new
  # a.should respond_to(:tag_list)
  # a.should respond_to(:tag_list=)
  # a.should respond_to(:tags)
  # a.should_not respond_to(:pet_list)
  # a.should_not respond_to(:pet_list=)
  # a.should_not respond_to(:pets)
  # a.should_not respond_to(:skill_list)
  # a.should_not respond_to(:skill_list=)
  # a.should_not respond_to(:skills)
  # end
  # end
end
Something went wrong with that request. Please try again.