Sha256: afae0c650f02c11cdb9b26fb2adab9aa5f649ebdced6e3b677fd67b298977617
Contents?: true
Size: 1.24 KB
Versions: 19
Compression:
Stored size: 1.24 KB
Contents
# Configure Rails Environment ENV["RAILS_ENV"] = "test" require File.expand_path("../dummy/config/environment.rb", __FILE__) require "rails/test_help" Rails.backtrace_cleaner.remove_silencers! # Load support files Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } # Load fixtures from the engine ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__) class ActiveSupport::TestCase # load db schema ActiveRecord::Schema.verbose = false load "#{Rails.root}/db/schema.rb" fixtures :all def simulate_device_pull(job) Extface.redis_block{ |r| sleep 1; r.publish(job.id, "OK") } #simulate send to device end end module Extface class ActionController::TestCase setup do @routes = Extface::Engine.routes end module Behavior def process_with_shop(action, http_method = 'GET', parameters = nil, session = nil, flash = nil) parameters = { shop_id: shops(:one) }.merge(parameters || {}) process_without_shop(action, http_method, parameters, session, flash) end alias_method_chain :process, :shop end end class ActionDispatch::Routing::RouteSet def default_url_options(options={}) options.merge(shop_id: Shop.first) end end end
Version data entries
19 entries across 19 versions & 1 rubygems