diff --git a/spec/mongoid/taggable_spec.rb b/spec/mongoid/taggable_spec.rb index 54b92a2..9f0bc2c 100644 --- a/spec/mongoid/taggable_spec.rb +++ b/spec/mongoid/taggable_spec.rb @@ -117,6 +117,11 @@ class Post article.keywords = "some,new,tag" article.keywords.should == %w[some new tag] end + + it "#keywords_before_type_cast" do + article.keywords = "some,new,tag" + article.keywords_before_type_cast.should eq "some, new, tag" + end end context "changing separator" do @@ -239,6 +244,12 @@ class Post end end + context "#tags_before_type_cast" do + subject { MyModel.new(:tags => %w[some new tag]) } + + its(:tags_before_type_cast) { should eq "some, new, tag" } + end + context "#self.tagged_with" do let!(:models) do [ @@ -287,6 +298,11 @@ class Post Article.keywords_with_weight.should include(['satire', 3]) Editorial.keywords_with_weight.should include(['satire', 3]) end + + it "#keywords_before_type_cast" do + editorial.keywords = %w[some new tag] + editorial.keywords_before_type_cast.should eq "some new tag" + end end context "using taggable module along with other mongoid modules" do