gitlab-org--gitlab-foss/spec/controllers
Stan Hu 779b9eac57 Merge branch 'fix-project-path-rename' into 'master'
Fix Error 500 after renaming a project path

Renaming the path of a project would result in an Error 500 due to `@repository` being memoized with the old path. An Error 500 would result:

```
Started GET "/testing2/test1" for 127.0.0.1 at 2016-04-04 12:42:30 +0000
Processing by ProjectsController#show as HTML
  Parameters: {"namespace_id"=>"testing2", "id"=>"test1"}
Completed 200 OK in 637ms (Views: 194.2ms | ActiveRecord: 111.8ms)
Started GET "/testing2/test1/edit" for 127.0.0.1 at 2016-04-04 12:42:33 +0000
Processing by ProjectsController#edit as HTML
  Parameters: {"namespace_id"=>"testing2", "id"=>"test1"}
Completed 200 OK in 594ms (Views: 183.8ms | ActiveRecord: 87.4ms)
Started PATCH "/testing2/test1" for 127.0.0.1 at 2016-04-04 12:42:41 +0000
Processing by ProjectsController#update as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "project"=>{"nam
e"=>"test123", "path"=>"test123"}, "namespace_id"=>"testing2", "id"=>"test1"}
Completed 500 Internal Server Error in 1852ms (ActiveRecord: 124.0ms)

ActionView::Template::Error (no repository for such path):
    2:   %legend
    3:     Builds:
    4:
    5:   - unless @repository.gitlab_ci_yml
    6:     .form-group
    7:       .col-sm-offset-2.col-sm-10
    8:         %p Builds need to be configured before you can begin using Contin
uous Integration.
  app/models/repository.rb:59:in `block in empty?'
  lib/repository_cache.rb:19:in `fetch'
  app/models/repository.rb:59:in `empty?'
  app/models/repository.rb:471:in `gitlab_ci_yml'
  app/views/projects/_builds_settings.html.haml:5:in `_app_views_projects__build
s_settings_html_haml__782034335636359229_73397600'
  app/views/projects/edit.html.haml:87:in `block in _app_views_projects_edit_htm
l_haml___2388082585934859365_47390860'
  app/views/projects/edit.html.haml:8:in `_app_views_projects_edit_html_haml___2
388082585934859365_47390860'
  app/controllers/projects_controller.rb:54:in `block (2 levels) in update'
  app/controllers/projects_controller.rb:43:in `update'
  lib/gitlab/middleware/go.rb:16:in `call'
```

Closes #14885

See merge request !3528
2016-04-05 22:16:15 +00:00
..
admin Minor clean up on admin/users_controller_spec 2016-03-31 22:29:32 +02:00
ci Redirect to root path when visiting `/ci` 2016-03-29 08:04:17 +02:00
groups Fix more specs 2016-03-20 23:09:33 +01:00
import Fix duplicate repositories in GitHub import page 2015-10-19 10:39:59 -07:00
profiles Revert "Merge branch 'avatar-cropping' into 'master' " 2016-03-15 14:55:40 +01:00
projects Respond 404 when unauthorized user imports members 2016-04-05 14:37:06 +02:00
abuse_reports_controller_spec.rb Add `AbuseReport#notify` 2016-01-04 18:59:42 -05:00
application_controller_spec.rb Fix some specs 2016-03-20 22:55:08 +01:00
autocomplete_controller_spec.rb Merge branch 'fix-autocomplete-spec' into 'master' 2016-02-23 10:11:39 +01:00
blob_controller_spec.rb Fix Style/AlignHash cop violations 2015-06-22 22:24:39 -07:00
commit_controller_spec.rb Use Gitlab::Git::DiffCollections 2016-03-03 18:38:44 +01:00
groups_controller_spec.rb Fix sorting issues/mrs by votes on the groups page 2016-03-21 17:01:38 -03:00
help_controller_spec.rb Fix Style/AlignHash cop violations 2015-06-22 22:24:39 -07:00
invites_controller_spec.rb Redirect to a default path if HTTP_REFERER is not set 2015-10-20 07:45:48 -07:00
namespaces_controller_spec.rb Fix more specs 2016-03-20 23:09:33 +01:00
projects_controller_spec.rb Fix Error 500 after renaming a project path 2016-04-05 11:18:13 -07:00
root_controller_spec.rb Implementing 'Groups View' and 'TODOs View' as options for dashboard preferences. 2016-03-24 19:59:54 +01:00
sent_notifications_controller_spec.rb Move a few controller specs to their correct locations 2016-02-18 21:50:49 -05:00
snippets_controller_spec.rb Fix raw private snippets access workflow 2015-11-25 18:16:27 -02:00
uploads_controller_spec.rb Fix more specs 2016-03-20 23:09:33 +01:00
users_controller_spec.rb include contributions from forked projects on profile calendar 2016-02-22 15:46:29 +01:00