Sha256: 33c8586401b4dabb412262d169b7c72b2c8b1a85148979a2d54ae11c590f5d9d

Contents?: true

Size: 1.08 KB

Versions: 47

Compression:

Stored size: 1.08 KB

Contents

require File.expand_path('../test_helper', File.dirname(__FILE__))

class RoutingExtensionsTest < ActionDispatch::IntegrationTest
  
  def teardown
    reset_config
    load(File.expand_path('config/routes.rb', Rails.root))
  end
  
  def test_get_admin_with_admin_route_prefix
    ComfortableMexicanSofa.config.admin_route_prefix = 'custom-admin'
    load(File.expand_path('config/routes.rb', Rails.root))
    
    assert_equal '/custom-admin/sites', cms_admin_sites_path
    http_auth :get, cms_admin_sites_path
    assert_response :success
  end
  
  def test_get_admin_with_admin_route_redirect
    ComfortableMexicanSofa.config.admin_route_redirect = '/cms-admin/sites'
    load(File.expand_path('config/routes.rb', Rails.root))
    
    http_auth :get, '/cms-admin'
    assert_response :redirect
    assert_redirected_to cms_admin_sites_path
  end
  
  def test_get_admin_with_admin_route_prefix_disabled
    ComfortableMexicanSofa.config.admin_route_prefix = ''
    load(File.expand_path('config/routes.rb', Rails.root))
    
    http_auth :get, '/cms-admin'
    assert_response 404
  end
  
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.6.2 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.6.1 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.6.0 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.5.11 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.5.10 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.5.9 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.5.8 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.5.7 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.5.6 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.5.5 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.5.4 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.5.3 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.5.2 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.5.1 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.5.0 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.4.22 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.4.21 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.4.20 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.4.19 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.4.18 test/integration/routing_extensions_test.rb