Sha256: a8fa9aafbbf1b723d6feddcb48c6e8bebf362359a0872a0fd7dadf564ed985ac

Contents?: true

Size: 1.47 KB

Versions: 25

Compression:

Stored size: 1.47 KB

Contents

require 'rails_helper'

describe ActiveAdmin::Application, :type => :request do

  include Rails.application.routes.url_helpers

  [false, nil].each do |value|

    describe "with a #{value} default namespace" do

      before(:all) do
        @__original_application = ActiveAdmin.application
        application = ActiveAdmin::Application.new
        application.default_namespace = value
        ActiveAdmin.application = application
        load_defaults!
        reload_routes!
      end

      after(:all) do
        ActiveAdmin.application = @__original_application
      end

      it "should generate a log out path" do
        expect(destroy_admin_user_session_path).to eq "/logout"
      end

      it "should generate a log in path" do
        expect(new_admin_user_session_path).to eq "/login"
      end

    end

  end

    describe "with a test default namespace" do

      before(:all) do
        @__original_application = ActiveAdmin.application
        application = ActiveAdmin::Application.new
        application.default_namespace = :test
        ActiveAdmin.application = application
        load_defaults!
        reload_routes!
      end

      after(:all) do
        ActiveAdmin.application = @__original_application
      end

      it "should generate a log out path" do
        expect(destroy_admin_user_session_path).to eq "/test/logout"
      end

      it "should generate a log in path" do
        expect(new_admin_user_session_path).to eq "/test/login"
      end

    end

end

Version data entries

25 entries across 25 versions & 4 rubygems

Version Path
activeadmin_addons-1.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/requests/default_namespace_spec.rb
activeadmin_addons-1.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/requests/default_namespace_spec.rb
yousty-activeadmin-1.0.17.pre spec/requests/default_namespace_spec.rb
yousty-activeadmin-1.0.16.pre spec/requests/default_namespace_spec.rb
activeadmin_addons-1.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/requests/default_namespace_spec.rb
activeadmin_addons-1.0.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/requests/default_namespace_spec.rb
activeadmin_addons-1.0.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/requests/default_namespace_spec.rb
yousty-activeadmin-1.0.15.pre spec/requests/default_namespace_spec.rb
activeadmin-orac-1.0.0.pre4 spec/requests/default_namespace_spec.rb
activeadmin-orac-1.0.0 spec/requests/default_namespace_spec.rb
activeadmin-orac-1.0.0.pre.orac spec/requests/default_namespace_spec.rb
yousty-activeadmin-1.0.14.pre spec/requests/default_namespace_spec.rb
yousty-activeadmin-1.0.13.pre spec/requests/default_namespace_spec.rb
yousty-activeadmin-1.0.12.pre spec/requests/default_namespace_spec.rb
yousty-activeadmin-1.0.11.pre spec/requests/default_namespace_spec.rb
yousty-activeadmin-1.0.10.pre spec/requests/default_namespace_spec.rb
yousty-activeadmin-1.0.9.pre spec/requests/default_namespace_spec.rb
yousty-activeadmin-1.0.8.pre spec/requests/default_namespace_spec.rb
activeadmin-1.0.0.pre4 spec/requests/default_namespace_spec.rb
activeadmin-1.0.0.pre3 spec/requests/default_namespace_spec.rb