# frozen_string_literal: true

require 'test_helper'

class RoutingTest < ActionDispatch::IntegrationTest
  include RouteTranslator::ConfigurationHelper

  def test_with_engine_inside_localized_block
    skip 'Regression with Rails 5.1.3. See #172'
    get '/engine_es'
    assert_response :success
    assert_equal '/blorgh/posts', response.body
  end

  def test_with_engine_outside_localized_block
    get '/engine'
    assert_response :success
    assert_equal '/blorgh/posts', response.body
  end
end

# frozen_string_literal: true

require 'test_helper'

class RoutingTest < ActionDispatch::IntegrationTest
  include RouteTranslator::ConfigurationHelper

  def test_with_engine_inside_localized_block
    get '/engine_es'
    assert_response :success
    assert_equal '/es/blorgh/posts', response.body
  end

  def test_with_engine_outside_localized_block
    get '/engine'
    assert_response :success
    assert_equal '/blorgh/posts', response.body
  end
end

Change test as per Rails 5.1.3 change
Change test as per Rails 5.1.3 change

We are going to assume that Rails is providing the correct behaviour
for this use case, so we change the test accordingly to make it pass.

Ref: ccfa785535d912c3529b0562d9f2e7a2dc4b7ed7@ff7f4a7 rails/rails#29662
Close: #172