Sha256: 51261674e34abd555621be724d68eedc419957b862b94703b0bc64a2cc26070b

Contents?: true

Size: 1.75 KB

Versions: 2

Compression:

Stored size: 1.75 KB

Contents

# Prevent warnings from showing up during testing.
$VERBOSE=nil

# Configure Rails Environment
ENV['RAILS_ENV'] = 'test'
ENV['DEFAULT_HOST'] = 'https://test.example.com'
ENV['SHOPIFY_APP_NAME'] = 'Test Application'
ENV['SHOPIFY_APP_API_KEY'] = 'f61b26d635309536c3c83c0adc3cb972'
ENV['SHOPIFY_APP_SECRET'] = 'b607d1f8b992dccb017f9315f07af9c4'
ENV['SHOPIFY_APP_REDIRECT_URI'] = 'https://test.example.com/shopify/auth/callback'
ENV['SHOPIFY_APP_SCOPE'] = 'read_products'
ENV['SHOPIFY_CHARGES_REAL'] = 'false'

require File.expand_path("../../test/dummy/config/environment.rb",  __FILE__)
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__)
require "rails/test_help"

# Require our additional test support helpers.
require 'support/test_file_fixtures'
require 'support/test_shopify_api'

# Require WebMock
require 'webmock/minitest'

# Filter out Minitest backtrace while allowing backtrace from other libraries
# to be shown.
Minitest.backtrace_filter = Minitest::BacktraceFilter.new

# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

# Load fixtures from the engine
if ActiveSupport::TestCase.respond_to?(:fixture_path=)
  ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
  ActiveSupport::TestCase.fixtures :all
end

# Set up the base test class.
class ActiveSupport::TestCase

  fixtures :all

  # Include helper modules common to all tests.
  include DiscoApp::Test::FileFixtures

  def log_in_as(shop)
    session[:shopify] = shop.id
    session[:shopify_domain] = shop.shopify_domain
  end

  def log_out
    session[:shopify] = nil
    session[:shopify_domain] = nil
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
disco_app-0.12.0 test/test_helper.rb
disco_app-0.12.1 test/test_helper.rb