Sha256: 41f04a719f84709dcd2d7d26287ec0f687cfe8e74f0260d15628cab74c3fb4ae

Contents?: true

Size: 1.42 KB

Versions: 2

Compression:

Stored size: 1.42 KB

Contents

# require File.dirname(__FILE__) + '/../../../../spec/spec_helper'
require 'rubygems'
require 'activerecord'
require 'spec'

module Spec::Example::ExampleGroupMethods
  alias :context :describe
end

class Array
  def freq
    k=Hash.new(0)
    each {|e| k[e]+=1}
    k
  end
end


TEST_DATABASE_FILE = File.join(File.dirname(__FILE__), '..', 'test.sqlite3')

File.unlink(TEST_DATABASE_FILE) if File.exist?(TEST_DATABASE_FILE)
ActiveRecord::Base.establish_connection(
  "adapter" => "sqlite3", "database" => TEST_DATABASE_FILE
)

RAILS_DEFAULT_LOGGER = Logger.new(File.join(File.dirname(__FILE__), "debug.log"))

load(File.dirname(__FILE__) + '/schema.rb')

$: << File.join(File.dirname(__FILE__), '..', 'lib')
require File.join(File.dirname(__FILE__), '..', 'init')


# let's run the tests with non-default table names.
class Tag
  set_table_name "v2_tags"
end

class Tagging
  set_table_name "v2_taggings"
end

class TaggableModel < ActiveRecord::Base
  acts_as_taggable
  acts_as_taggable_on :languages
  acts_as_taggable_on :skills
  acts_as_taggable_on :needs, :offerings
end

class OtherTaggableModel < ActiveRecord::Base
  acts_as_taggable_on :tags, :languages
  acts_as_taggable_on :needs, :offerings
end

class InheritingTaggableModel < TaggableModel
end

class AlteredInheritingTaggableModel < TaggableModel
  acts_as_taggable_on :parts
end

class TaggableUser < ActiveRecord::Base
  acts_as_tagger
end

class UntaggableModel < ActiveRecord::Base
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bbenezech-acts-as-taggable-on-0.0.4 spec/spec_helper.rb
bbenezech-acts-as-taggable-on-0.0.3 spec/spec_helper.rb