Sha256: 3ad1fe8804ebcf3d700a4f5c236ce5613ef9ba78140ceeb8be7a3371149a0c5b

Contents?: true

Size: 892 Bytes

Versions: 1

Compression:

Stored size: 892 Bytes

Contents

ENV['RAILS_ENV'] = 'test'
require 'simplecov'

require 'rails'

I18n.config.enforce_available_locales = false
ActiveSupport::TestCase.test_order = :random

require 'active_record'
require 'rails/test_help'
require 'mocha/api'

require 'superstore'

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

module Superstore
  class TestCase < ActiveSupport::TestCase
    def temp_object(&block)
      Class.new(Superstore::Base) do
        self.table_name = 'issues'
        attribute :force_save, type: :string
        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
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
superstore-3.0.0 test/test_helper.rb