Skip to content

Commit

Permalink
Fix broken spec around case sensitive taggings
Browse files Browse the repository at this point in the history
  • Loading branch information
bnorton committed Oct 9, 2012
1 parent 53e2e14 commit c27038e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions spec/acts_as_taggable_on/tag_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@
describe "when using strict_case_match" do
before do
ActsAsTaggableOn.strict_case_match = true
@tag.name = "awesome"
@tag.save!
end

after do
Expand All @@ -164,17 +166,18 @@
end

it "should find by name case sensitively" do
tag_count = ActsAsTaggableOn::Tag.count
tag = ActsAsTaggableOn::Tag.find_or_create_with_like_by_name("AWESOME")
expect {
ActsAsTaggableOn::Tag.find_or_create_with_like_by_name("AWESOME")
}.to change(ActsAsTaggableOn::Tag, :count)

ActsAsTaggableOn::Tag.count.should == tag_count + 1
tag.name.should == "AWESOME"
ActsAsTaggableOn::Tag.last.name.should == "AWESOME"
end

it "should have a named_scope named(something) that matches exactly" do
uppercase_tag = ActsAsTaggableOn::Tag.create(:name => "Cool")
@tag.name = "cool"
@tag.save!

ActsAsTaggableOn::Tag.named('cool').should include(@tag)
ActsAsTaggableOn::Tag.named('cool').should_not include(uppercase_tag)
end
Expand Down

0 comments on commit c27038e

Please sign in to comment.