Permalink
Browse files

Bumping gemspec again.

  • Loading branch information...
1 parent 8cbacc6 commit 08b9d7d4c9ad9e46a5d1edb687d42f89739b70e8 Michael Bleigh committed Mar 26, 2009
Showing with 13 additions and 2 deletions.
  1. +1 −1 acts-as-taggable-on.gemspec
  2. +12 −1 spec/acts_as_taggable_on/taggable_spec.rb
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "acts-as-taggable-on"
- s.version = "1.0.4"
+ s.version = "1.0.5"
s.date = "2008-06-10"
s.summary = "Tagging for ActiveRecord with custom contexts and advanced features."
s.email = "michael@intridea.com"
@@ -105,6 +105,17 @@
bob.save
TaggableModel.find_tagged_with("spinning", :on => :rotors).should_not be_empty
end
+
+ it "should be able to use named scopes to chain tag finds" do
+ bob = TaggableModel.create(:name => "Bob", :tag_list => "fitter, happier, more productive", :skill_list => "ruby, rails, css")
+ frank = TaggableModel.create(:name => "Frank", :tag_list => "weaker, depressed, inefficient", :skill_list => "ruby, rails, css")
+ steve = TaggableModel.create(:name => 'Steve', :tag_list => 'fitter, happier, more productive', :skill_list => 'c++, java, python')
+
+ # Let's only find those productive Rails developers
+ TaggableModel.tagged_with('rails', :on => :skills).all(:order => 'taggable_models.name').should == [bob, frank]
+ TaggableModel.tagged_with('happier', :on => :tags).all(:order => 'taggable_models.name').should == [bob, steve]
+ TaggableModel.tagged_with('rails', :on => :skills).tagged_with('happier', :on => :tags).should == [bob]
+ end
describe "Single Table Inheritance" do
before do
@@ -133,4 +144,4 @@
AlteredInheritingTaggableModel.find_tagged_with("fork", :on => :parts).first.should == @inherited_different
end
end
-end
+end

0 comments on commit 08b9d7d

Please sign in to comment.