Skip to content

Commit

Permalink
Add tests to ensure protection of redirects file.
Browse files Browse the repository at this point in the history
  • Loading branch information
bartkamphorst committed Oct 5, 2019
1 parent 8f104ec commit 7458e39
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test_allow_editing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@
assert page.nil?
end

test ".redirects.gollum file should not be accessible" do
Precious::App.set(:wiki_options, { allow_editing: true, allow_uploads: true })
get '/.redirects.gollum'
assert_match /Accessing this resource is not allowed/, last_response.body
end

test ".redirects.gollum file should not be editable" do
Precious::App.set(:wiki_options, { allow_editing: true, allow_uploads: true })
get '/gollum/edit/.redirects.gollum'
assert_match /Changing this resource is not allowed/, last_response.body
end

test "frontend links for editing are not blocked" do
Precious::App.set(:wiki_options, { allow_editing: true, allow_uploads: true })
Expand Down

0 comments on commit 7458e39

Please sign in to comment.