提交 c5059cb4 编写于 作者: B Bob Van Landuyt

Make path validation case-insensitive

上级 27f54beb
......@@ -94,6 +94,7 @@ class DynamicPathValidator < ActiveModel::EachValidator
end
def self.reserved?(value, type: :strict)
value = value.to_s.downcase
case type
when :wildcard
WILDCARD_ROUTES.include?(value)
......
......@@ -81,7 +81,13 @@ describe DynamicPathValidator do
end
end
describe '#valid_full_path' do
describe ".valid?" do
it 'is not case sensitive' do
expect(described_class.valid?("Users", type: :top_level)).to be(false)
end
end
describe '.valid_full_path' do
it "isn't valid when the top level is reserved" do
test_path = 'u/should-be-a/reserved-word'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册