Sha256: b91b0ab877f26c3e733a50049377d07d40eca7adedb00b141ce50942b1102c8a

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

require 'rails_helper'

RSpec.describe ActiveAdmin::Application, type: :request do

  include Rails.application.routes.url_helpers

  [false, nil].each do |value|

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

      around(:all) do |example|
        application = ActiveAdmin::Application.new
        application.default_namespace = value

        with_temp_application(application) { example.call }
      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

    around(:all) do |example|
      application = ActiveAdmin::Application.new
      application.default_namespace = :test

      with_temp_application(application) { example.call }
    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

1 entries across 1 versions & 1 rubygems

Version Path
activeadmin-1.0.0.pre5 spec/requests/default_namespace_spec.rb