Skip to content

Instantly share code, notes, and snippets.

@apauly
Last active June 26, 2019 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apauly/e503c46d053db9382ce94c3d9031f95f to your computer and use it in GitHub Desktop.
Save apauly/e503c46d053db9382ce94c3d9031f95f to your computer and use it in GitHub Desktop.
Nested scopes bug report
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# gem "rails", "~> 5.1.0" # works
gem "rails", "~> 5.2.0" # does not work
end
require "active_support"
require "active_support/core_ext/object/blank"
require "minitest/autorun"
require "action_controller/railtie"
class TestApp < Rails::Application
config.root = __dir__
config.logger = Logger.new($stdout)
Rails.logger = config.logger
routes.draw do
scope "(:locale)" do
scope "(:platform)" do
root to: "projects#index"
end
end
end
end
class BugTest < Minitest::Test
include Rails.application.routes.url_helpers
def test_root_path_with_provided_optional_scope
assert_equal root_path(locale: 'locale'), '/locale'
assert_equal root_path(locale: 'locale', platform: 'platform'), '/locale/platform'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment