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
|
||||
|
||||
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.')
|
||||
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.')
|
||||
end
|
||||
|
||||
|
||||
@@ -524,6 +524,8 @@ context "Frontend" do
|
||||
get "/gollum/#{route}/custom#{ext}"
|
||||
assert_equal 403, last_response.status, "get /gollum/#{route}/custom#{ext} -- #{last_response.inspect}"
|
||||
end
|
||||
get "/gollum/#{route}/mathjax.config.js"
|
||||
assert_equal 403, last_response.status, "get /gollum/#{route}/mathjax.config.js -- #{last_response.inspect}"
|
||||
end
|
||||
|
||||
['delete', 'rename', 'edit', 'create'].each do |route|
|
||||
@@ -531,6 +533,8 @@ context "Frontend" do
|
||||
post "/gollum/#{route}/custom#{ext}"
|
||||
assert_equal 403, last_response.status, "post /gollum/#{route}/custom#{ext} -- #{last_response.inspect}"
|
||||
end
|
||||
post "/gollum/#{route}/mathjax.config.js"
|
||||
assert_equal 403, last_response.status, "post /gollum/#{route}/mathjax.config.js -- #{last_response.inspect}"
|
||||
end
|
||||
|
||||
['.css', '.js'].each do |ext|
|
||||
|
||||
Reference in New Issue
Block a user