Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

We have to explicitly order by id column becouse postgresql doesn't d…

…o it by default
  • Loading branch information...
commit bbaa1a6b4be4903d33d4796352eea0789109dc91 1 parent c4d1666
Kamil Giszczak authored tomeric committed
Showing with 6 additions and 6 deletions.
  1. +6 −6 spec/acts_as_taggable_on/taggable_spec.rb
View
12 spec/acts_as_taggable_on/taggable_spec.rb
@@ -108,7 +108,7 @@
charlie = TaggableModel.create(:name => "Charlie", :skill_list => "ruby")
TaggableModel.all_tag_counts.all.should_not be_empty
- TaggableModel.all_tag_counts.first.count.should == 3 # ruby
+ TaggableModel.all_tag_counts(:order => 'tags.id').first.count.should == 3 # ruby
end
if ActiveRecord::VERSION::MAJOR >= 3
@@ -132,7 +132,7 @@
frank = TaggableModel.create(:name => "Frank", :tag_list => "ruby, rails")
charlie = TaggableModel.create(:name => "Charlie", :skill_list => "ruby")
- TaggableModel.tagged_with("ruby").tag_counts.first.count.should == 2 # ruby
+ TaggableModel.tagged_with("ruby").tag_counts(:order => 'tags.id').first.count.should == 2 # ruby
TaggableModel.tagged_with("ruby").skill_counts.first.count.should == 1 # ruby
end
@@ -141,7 +141,7 @@
frank = TaggableModel.create(:name => "Frank", :tag_list => "ruby, rails")
charlie = TaggableModel.create(:name => "Charlie", :skill_list => "ruby")
- TaggableModel.tagged_with("ruby").all_tag_counts.first.count.should == 3 # ruby
+ TaggableModel.tagged_with("ruby").all_tag_counts(:order => 'tags.id').first.count.should == 3 # ruby
end
it 'should only return tag counts for the available scope' do
@@ -298,9 +298,9 @@
@inherited_different.tag_list = "fork, spoon"
@inherited_different.save!
- InheritingTaggableModel.tag_counts_on(:tags).map(&:name).should == %w(bob kelso)
- AlteredInheritingTaggableModel.tag_counts_on(:tags).map(&:name).should == %w(fork spoon)
- TaggableModel.tag_counts_on(:tags).map(&:name).should == %w(bob kelso fork spoon)
+ InheritingTaggableModel.tag_counts_on(:tags, :order => 'tags.id').map(&:name).should == %w(bob kelso)
+ AlteredInheritingTaggableModel.tag_counts_on(:tags, :order => 'tags.id').map(&:name).should == %w(fork spoon)
+ TaggableModel.tag_counts_on(:tags, :order => 'tags.id').map(&:name).should == %w(bob kelso fork spoon)
end
it 'should store same tag without validation conflict' do
Please sign in to comment.
Something went wrong with that request. Please try again.