Sha256: 268f24febd512a7d5b420d0352b2be2d912781c3126f142eb195df74edf829a4

Contents?: true

Size: 1.65 KB

Versions: 4

Compression:

Stored size: 1.65 KB

Contents

ENV["RAILS_ENV"] ||= 'test'
ENV['REDIS_URL'] ||= 'redis://localhost:6379/9'

require "inst_data_shipper"
require File.expand_path("../dummy/config/environment.rb", __FILE__)
# Rails::Generators.invoke("canvas_sync:install", ["--models", "all"], destination_root: Rails.root)
require "bundler/setup"
require 'rspec/rails'
require 'spec_helper'
require 'factory_bot_rails'
require 'timecop'
require 'webmock/rspec'
require 'support/test_dumper'
require 'shoulda/matchers'
require 'pry'
require 'pry-nav'
require 'with_model'

require 'sidekiq/testing'
Sidekiq::Testing.fake!

ActiveRecord::Migration.maintain_test_schema!

RSpec.configure do |config|
  config.extend WithModel

  config.include FactoryBot::Syntax::Methods
  config.use_transactional_fixtures = true
  config.infer_spec_type_from_file_location!
  config.filter_rails_from_backtrace!

  # Enable flags like --only-failures and --next-failure
  config.example_status_persistence_file_path = ".rspec_status"

  # Disable RSpec exposing methods globally on `Module` and `main`
  config.disable_monkey_patching!

  config.expect_with :rspec do |c|
    c.syntax = :expect
  end
end

Shoulda::Matchers.configure do |config|
  config.integrate do |with|
    with.test_framework :rspec
    with.library :rails
  end
end

def open_canvas_fixture(name)
  data = File.open(File.dirname(__FILE__) + '/support/fixtures/canvas_responses/' + name + '.json', 'rb').read
  JSON.parse(data)
end

def canvas_sync_client
  Bearcat::Client.new(token: 'cool-token', prefix: 'http://test.instructure.com')
end

def set_batch_context(ctx)
  allow_any_instance_of(ActiveJob::Base).to receive(:batch_context).and_return(ctx.with_indifferent_access)
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
inst_data_shipper-0.2.6 spec/spec_helper.rb
inst_data_shipper-0.2.5 spec/spec_helper.rb
inst_data_shipper-0.2.4 spec/spec_helper.rb
inst_data_shipper-0.2.3 spec/spec_helper.rb