Skip to content

Commit

Permalink
tagged_with([]) should return [] mbleigh#191
Browse files Browse the repository at this point in the history
  • Loading branch information
artemk committed Sep 26, 2011
1 parent 8787a8e commit 7604945
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions spec/acts_as_taggable_on/tag_list_spec.rb
Expand Up @@ -62,6 +62,10 @@
@tag_list.to_s.should == "awesome, radical, cool, \"rad,bodacious\""
end

it "#from should return empty array if empty array is passed" do
ActsAsTaggableOn::TagList.from([]).should == []
end

it "should be able to call to_s on a frozen tag list" do
@tag_list.freeze
lambda { @tag_list.add("cool","rad,bodacious") }.should raise_error
Expand Down
3 changes: 2 additions & 1 deletion spec/acts_as_taggable_on/taggable_spec.rb
Expand Up @@ -264,7 +264,8 @@
it "should return an empty scope for empty tags" do
TaggableModel.tagged_with('').should == []
TaggableModel.tagged_with(' ').should == []
TaggableModel.tagged_with(nil).should == []
TaggableModel.tagged_with(nil).should == []
TaggableModel.tagged_with([]).should == []
end

it "should not create duplicate taggings" do
Expand Down

0 comments on commit 7604945

Please sign in to comment.