diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-02 22:39:28 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-02 22:39:28 +0000 |
commit | c530ca00b0f40ec0e0df4d1885ce55e47a59b70d (patch) | |
tree | 6eb0adb325081db21c9010b7271c2551f51fce47 /lib/api/notes.rb | |
parent | ed3bd155fcd139ba1898fd4a29ff76924f6fe756 (diff) | |
parent | 4bc5c66fe12a2dc5d8fe9ed5878da5dea2444442 (diff) | |
download | gitlab-ce-c530ca00b0f40ec0e0df4d1885ce55e47a59b70d.tar.gz |
Merge branch 'fix-protected-branches-routing' into 'master'
Fix protected branches routing
### Summary
On the master branch, if you attempt to access the protected branches in the project settings with an empty repo, you get `NoMethodError - undefined method "project_url"`.
### Steps to reproduce
1. Check out GitLab master and run.
2. Create a new project.
3. Go to Settings.
4. Click on "Protected branches"
### Expected behavior
The controller is supposed to redirect back to the projects page since there are no branches.
### Observed behavior
Internal Error 500
### Relevant logs
```
NoMethodError - undefined method `project_url' for #<Projects::ProtectedBranchesController:0x007fd920054af0>:
app/controllers/application_controller.rb:157:in `method_missing'
actionpack (4.1.9) lib/action_dispatch/routing/polymorphic_routes.rb:142:in `polymorphic_url'
actionpack (4.1.9) lib/action_dispatch/routing/url_for.rb:161:in `url_for'
actionpack (4.1.9) lib/action_controller/metal/redirecting.rb:91:in `_compute_redirect_to_location'
turbolinks (2.0.0) lib/turbolinks.rb:15:in `_compute_redirect_to_location_with_xhr_referer'
actionpack (4.1.9) lib/action_controller/metal/redirecting.rb:71:in `redirect_to
```
### Fix
I added a unit test for the empty project case and replicated the issue. I added the URL router helpers that appear to be necessary after 42387b733b76dfc1f72585015910a50f094e264f.
See merge request !359
Diffstat (limited to 'lib/api/notes.rb')
0 files changed, 0 insertions, 0 deletions