Sha256: 1ee4ec24883da9b895eaf29654f80930931ad06d6ec3fe6490240c890c4685b4

Contents?: true

Size: 1.9 KB

Versions: 65

Compression:

Stored size: 1.9 KB

Contents

require 'spec_helper'

describe ActiveAdmin::Application 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 dashboard controller" do
        defined?(::DashboardController).should be_true
      end

      it "should generate a dashboard route" do
        dashboard_path.should == "/"
      end

      it "should generate a log out path" do
        destroy_admin_user_session_path.should == "/admin_users/logout"
      end

      it "should generate a log in path" do
        new_admin_user_session_path.should == "/admin_users/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 dashboard controller" do
        defined?(::Test::DashboardController).should be_true
      end

      it "should generate a dashboard route" do
        test_dashboard_path.should == "/test"
      end

      it "should generate a log out path" do
        destroy_admin_user_session_path.should == "/test/logout"
      end

      it "should generate a log in path" do
        new_admin_user_session_path.should == "/test/login"
      end

    end

end

Version data entries

65 entries across 65 versions & 4 rubygems

Version Path
lalala-4.0.0.dev.141 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.136 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.135 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.134 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.133 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.132 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.131 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.129 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.128 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.126 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.125 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.124 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.123 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.118 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.116 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.114 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.113 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.111 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.109 vendor/deps/active_admin/spec/integration/default_namespace.rb
lalala-4.0.0.dev.107 vendor/deps/active_admin/spec/integration/default_namespace.rb