diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-05-16 02:13:36 +0300 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-06-05 15:32:26 +0300 |
commit | ff8a053d5ddf154cd52c3e21ac24619dbbee0dc7 (patch) | |
tree | 799e225f3cf02de76aa0d9c3fa66766e4e7b05c5 /lib/gitlab/git_access_wiki.rb | |
parent | c34107608ecc5c36e80a748eb4c9b88d2b1157cf (diff) |
Fix Git over HTTP spec
* The spec has 7 failures at this point
* Specify rendered error messages
* Render the GitAccess message rather than “Access denied”
* Render the Not Found message provided by GitAccess, instead of a custom one
* Expect GitAccess to check the config for whether Git-over-HTTP pull or push is disabled, rather than doing it in the controller
* Add more thorough testing for authentication
* Dried up a lot of tests
* Fixed some broken tests
Diffstat (limited to 'lib/gitlab/git_access_wiki.rb')
-rw-r--r-- | lib/gitlab/git_access_wiki.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/git_access_wiki.rb b/lib/gitlab/git_access_wiki.rb index 67eaa5e088d..dccafd2cae8 100644 --- a/lib/gitlab/git_access_wiki.rb +++ b/lib/gitlab/git_access_wiki.rb @@ -1,5 +1,9 @@ module Gitlab class GitAccessWiki < GitAccess + ERROR_MESSAGES = { + write_to_wiki: "You are not allowed to write to this project's wiki." + }.freeze + def guest_can_download_code? Guest.can?(:download_wiki_code, project) end @@ -12,7 +16,7 @@ module Gitlab if user_access.can_do_action?(:create_wiki) build_status_object(true) else - build_status_object(false, "You are not allowed to write to this project's wiki.") + build_status_object(false, ERROR_MESSAGES[:write_to_wiki]) end end end |