Added tests for mathjax.config.js permissions. Fixed typo in permission regex.
This commit is contained in:
+2
-2
@@ -152,11 +152,11 @@ module Precious
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
get %r{/(edit|create)/(custom|mathjax\.config\.)\.(js|css)} do
|
get %r{/(edit|create)/(custom|mathjax\.config)\.(js|css)} do
|
||||||
forbid('Changing this resource is not allowed.')
|
forbid('Changing this resource is not allowed.')
|
||||||
end
|
end
|
||||||
|
|
||||||
post %r{/(delete|rename|edit|create)/(custom|mathjax\.config\.)\.(js|css)} do
|
post %r{/(delete|rename|edit|create)/(custom|mathjax\.config)\.(js|css)} do
|
||||||
forbid('Changing this resource is not allowed.')
|
forbid('Changing this resource is not allowed.')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -524,6 +524,8 @@ context "Frontend" do
|
|||||||
get "/gollum/#{route}/custom#{ext}"
|
get "/gollum/#{route}/custom#{ext}"
|
||||||
assert_equal 403, last_response.status, "get /gollum/#{route}/custom#{ext} -- #{last_response.inspect}"
|
assert_equal 403, last_response.status, "get /gollum/#{route}/custom#{ext} -- #{last_response.inspect}"
|
||||||
end
|
end
|
||||||
|
get "/gollum/#{route}/mathjax.config.js"
|
||||||
|
assert_equal 403, last_response.status, "get /gollum/#{route}/mathjax.config.js -- #{last_response.inspect}"
|
||||||
end
|
end
|
||||||
|
|
||||||
['delete', 'rename', 'edit', 'create'].each do |route|
|
['delete', 'rename', 'edit', 'create'].each do |route|
|
||||||
@@ -531,6 +533,8 @@ context "Frontend" do
|
|||||||
post "/gollum/#{route}/custom#{ext}"
|
post "/gollum/#{route}/custom#{ext}"
|
||||||
assert_equal 403, last_response.status, "post /gollum/#{route}/custom#{ext} -- #{last_response.inspect}"
|
assert_equal 403, last_response.status, "post /gollum/#{route}/custom#{ext} -- #{last_response.inspect}"
|
||||||
end
|
end
|
||||||
|
post "/gollum/#{route}/mathjax.config.js"
|
||||||
|
assert_equal 403, last_response.status, "post /gollum/#{route}/mathjax.config.js -- #{last_response.inspect}"
|
||||||
end
|
end
|
||||||
|
|
||||||
['.css', '.js'].each do |ext|
|
['.css', '.js'].each do |ext|
|
||||||
|
|||||||
Reference in New Issue
Block a user