Sha256: be500677f24b57fab49f8dfab90b144f86ee0548a173a9600b742a21977e15c4

Contents?: true

Size: 899 Bytes

Versions: 2

Compression:

Stored size: 899 Bytes

Contents

require 'bundler/setup'
Bundler.require(:default, :test)

I18n.config.enforce_available_locales = false

require 'active_record'
require 'rails/test_help'
require 'mocha/setup'

ActiveSupport::TestCase.test_order = :random

require 'support/pg'
require 'support/jsonb'
require 'support/models'

def MiniTest.filter_backtrace(bt)
  bt
end

module Superstore
  class TestCase < ActiveSupport::TestCase
    def temp_object(&block)
      Class.new(Superstore::Base) do
        self.table_name = 'Issues'
        string :force_save
        before_save { self.force_save = 'junk' }

        def self.name
          'Issue'
        end

        instance_eval(&block) if block_given?
      end
    end
  end

  module Types
    class TestCase < Superstore::TestCase
      attr_accessor :type
      setup do
        @type = self.class.name.sub(/Test$/, '').constantize.new(Issue)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
superstore-2.0.1 test/test_helper.rb
superstore-2.0.0 test/test_helper.rb