Sha256: 63abff1d64289e8f7099b352a7bc0b4c0a41a3b6e526331a49010654637dc5eb

Contents?: true

Size: 741 Bytes

Versions: 21

Compression:

Stored size: 741 Bytes

Contents

require "action_dispatch"
require "capybara/rails"
require "capybara/dsl"

module ActiveAdminRequestHelpers
  extend ActiveSupport::Concern

  include ActionDispatch::Integration::Runner
  include RSpec::Rails::TestUnitAssertionAdapter
  include ActionDispatch::Assertions
  include Capybara::DSL
  include RSpec::Matchers

  def app
    ::Rails.application
  end

  def last_response
    page
  end

  included do
    before do
      @router = ::Rails.application.routes
    end
  end

  def with_temp_application(application)
    original_application = ActiveAdmin.application
    ActiveAdmin.application = application
    load_defaults!
    reload_routes!

    yield

  ensure
    ActiveAdmin.application = original_application
  end
end

Version data entries

21 entries across 21 versions & 4 rubygems

Version Path
activeadmin-rails-1.7.1 spec/support/active_admin_request_helpers.rb
activeadmin-rails-1.7.0 spec/support/active_admin_request_helpers.rb
activeadmin-rb-1.6.0 spec/support/active_admin_request_helpers.rb
activeadmin-rb-1.5.2 spec/support/active_admin_request_helpers.rb
activeadmin-rb-1.5.1 spec/support/active_admin_request_helpers.rb
activeadmin-rb-1.5.0 spec/support/active_admin_request_helpers.rb
activeadmin_addons-1.7.1 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/spec/support/active_admin_request_helpers.rb
activeadmin-rb-1.4.0 spec/support/active_admin_request_helpers.rb
activeadmin_addons-1.7.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/spec/support/active_admin_request_helpers.rb
activeadmin-1.3.1 spec/support/active_admin_request_helpers.rb
activeadmin_addons-1.6.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/spec/support/active_admin_request_helpers.rb
activeadmin_addons-1.5.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/spec/support/active_admin_request_helpers.rb
activeadmin-1.3.0 spec/support/active_admin_request_helpers.rb
activeadmin_addons-1.4.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/spec/support/active_admin_request_helpers.rb
activeadmin_addons-1.3.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/spec/support/active_admin_request_helpers.rb
activeadmin_addons-1.2.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/spec/support/active_admin_request_helpers.rb
activeadmin-1.2.1 spec/support/active_admin_request_helpers.rb
activeadmin-1.2.0 spec/support/active_admin_request_helpers.rb
activeadmin-1.1.0 spec/support/active_admin_request_helpers.rb
activeadmin-1.0.0 spec/support/active_admin_request_helpers.rb