Last active
June 26, 2019 14:18
-
-
Save apauly/e503c46d053db9382ce94c3d9031f95f to your computer and use it in GitHub Desktop.
Nested scopes bug report
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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