Sha256: 99d404db9c4301c3f917b91df891f0668a791092161e5f441813b2847cbe26bc

Contents?: true

Size: 651 Bytes

Versions: 4

Compression:

Stored size: 651 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe "Group Helper" do
  before(:each) do
    clean_database!    
  end

  describe "grouped_column_names_for method" do
    before(:each) do
      @taggable = TaggableModel.new(:name => "Bob Jones")
    end

    it "should return all column names joined for Tag GROUP clause" do
      @taggable.grouped_column_names_for(Tag).should == "tags.id, tags.name"
    end

    it "should return all column names joined for TaggableModel GROUP clause" do
      @taggable.grouped_column_names_for(TaggableModel).should == "taggable_models.id, taggable_models.name, taggable_models.type"
    end
  end
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
acts-as-taggable-on-simonwh-2.0.0.pre1 spec/acts_as_taggable_on/group_helper_spec.rb
simonwh-acts-as-taggable-on-2.0.0.pre1 spec/acts_as_taggable_on/group_helper_spec.rb
acts-as-taggable-on-2.0.0.pre1 spec/acts_as_taggable_on/group_helper_spec.rb
acts-as-taggable-on-1.1.6 spec/acts_as_taggable_on/group_helper_spec.rb