Sha256: 347046ee6df25e7c824d2d0d6fac264df14002859ec538143ff74bd8570cbcaa

Contents?: true

Size: 1.11 KB

Versions: 14

Compression:

Stored size: 1.11 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
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

14 entries across 14 versions & 1 rubygems

Version Path
extface-0.4.4b test/test_helper.rb
extface-0.4.4a test/test_helper.rb
extface-0.4.4 test/test_helper.rb
extface-0.4.3g test/test_helper.rb
extface-0.4.3f test/test_helper.rb
extface-0.4.3e test/test_helper.rb
extface-0.4.3d test/test_helper.rb
extface-0.4.3c test/test_helper.rb
extface-0.4.3b test/test_helper.rb
extface-0.4.3a test/test_helper.rb
extface-0.4.2a test/test_helper.rb
extface-0.4.2 test/test_helper.rb
extface-0.4.1b test/test_helper.rb
extface-0.4.1a test/test_helper.rb