Sha256: 753768ef872db5685bfa50fc0973014e551eb14a85605746891beb9d2a7e5f60

Contents?: true

Size: 709 Bytes

Versions: 3

Compression:

Stored size: 709 Bytes

Contents

require 'active_record'
require 'minitest/autorun'
require 'inquery'
require 'db/models'

ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'

module TestHelper
  extend ActiveSupport::Concern

  module ClassMethods
    def setup_db
      load "#{File.dirname(__FILE__)}/db/schema.rb"
    end

    def setup_base_data
      Group.create!(name: 'Group 1', color: 'red')
      Group.create!(name: 'Group 2', color: 'green')
      Group.create!(name: 'Group 3', color: 'green')

      User.create!(name: 'User 1', groups: Group.find([1, 2]))
      User.create!(name: 'User 2', groups: Group.find([1, 3]))
      User.create!(name: 'User 3', groups: Group.find([2]))
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
inquery-1.0.11 test/test_helper.rb
inquery-1.0.10 test/test_helper.rb
inquery-1.0.9 test/test_helper.rb