Skip to content

Commit

Permalink
We have to explicitly order by id column becouse postgresql doesn't d…
Browse files Browse the repository at this point in the history
…o it by default
  • Loading branch information
Kamil Giszczak authored and tomeric committed May 19, 2010
1 parent c4d1666 commit bbaa1a6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spec/acts_as_taggable_on/taggable_spec.rb
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bbaa1a6

Please sign in to comment.