Sha256: 3a28633b52ebab5abe5fcb28242b6b5e4b5225c3e19ba39f825015852a8ebd66

Contents?: true

Size: 1022 Bytes

Versions: 9

Compression:

Stored size: 1022 Bytes

Contents

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

class RoutingExtensionsTest < ActionDispatch::IntegrationTest
  
  def teardown
    reset_config
    Rails.application.reload_routes!
  end
  
  def test_get_admin_with_admin_route_prefix
    ComfortableMexicanSofa.config.admin_route_prefix = 'custom-admin'
    Rails.application.reload_routes!
    
    http_auth :get, '/cms-admin/sites'
    assert_response 404
    
    http_auth :get, '/custom-admin/sites'
    assert_response :success
  end
  
  def test_get_admin_with_admin_route_redirect
    ComfortableMexicanSofa.config.admin_route_redirect = '/cms-admin/sites'
    Rails.application.reload_routes!
    
    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 = ''
    Rails.application.reload_routes!
    
    http_auth :get, '/cms-admin'
    assert_response 404
  end
  
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.6.11 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.6.10 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.6.9 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.6.8 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.6.7 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.6.6 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.6.5 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.6.4 test/integration/routing_extensions_test.rb
comfortable_mexican_sofa-1.6.3 test/integration/routing_extensions_test.rb