gitlab-org--gitlab-foss/spec
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
..
config Don't load all of GitLab in mail_room 2016-02-26 18:48:13 -08:00
controllers Merge branch 'fix-project-path-rename' into 'master' 2016-04-05 22:16:15 +00:00
factories Reload forked_project_link projects 2016-04-04 21:05:51 +02:00
features Merge branch 'note-form-design' into 'master' 2016-04-05 19:34:16 +00:00
finders Fix specs 2016-03-22 00:23:58 +01:00
fixtures Improve and finish the fallback to the In-Reply-To and References header for the reply-by-email feature 2016-03-25 13:05:15 +01:00
helpers Implementing 'Groups View' and 'TODOs View' as options for dashboard preferences. 2016-03-24 19:59:54 +01:00
initializers Ensure Gravatar host looks like an actual host 2016-01-18 14:58:16 +01:00
javascripts Merge branch 'close-issue-bug' into 'master' 2016-04-05 20:48:00 +00:00
lib Wrap images in discussions and wikis with a link to the image source using ImageLinkFilter. 2016-04-04 19:44:07 -06:00
mailers Premailer shouldn't remove script tags from our emails 2016-04-05 17:03:34 -04:00
models Flush repository cache before import project data 2016-04-04 19:35:39 -03:00
requests Merge branch 'add-ability-to-archive-a-project-via-api-14296' into 'master' 2016-04-03 13:19:25 +00:00
routing Remove `Profile::KeysController#new` action 2016-03-03 16:13:59 -05:00
services Merge branch 'reorder-language' into 'master' 2016-04-05 13:46:14 +00:00
support Fix creation of merge requests for orphaned branches 2016-04-04 04:51:05 -07:00
tasks/gitlab Ensure uploads dir exists when running backup specs 2016-03-30 15:40:49 +02:00
views Move "I should see Crowd login form" feature to a view spec 2016-02-24 17:38:13 -05:00
workers Migrate Repository#local_branches from gitlab-ee. 2016-04-01 14:21:08 -05:00
factories_spec.rb Add support for not Active Record based factories 2016-03-30 10:44:18 +02:00
rails_helper.rb
spec_helper.rb Move CarrierWave test env config to separate file 2016-03-30 13:57:01 +02:00
teaspoon_env.rb