gitlab-org--gitlab-foss/spec
Stan Hu d800a949d2 Fix Error 500 when creating global milestones with Unicode characters
Two issues:

1. The constraints in the resources were incorrect. Here's what it was before:
```
group_milestone  GET /groups/:group_id/milestones/:id(.:format)  groups/milestones#show {:id=>/[a-zA-Z.0-9_\-]+(?<!\.atom)/, :group_id=>/[a-zA-Z.0-9_\-]+(?<!\.atom)/}
```

In this case, id is actually the title of the milestone, which can be anything at the moment.

After:

```
group_milestone  GET /groups/:group_id/milestones/:id(.:format)  groups/milestones#show {:id=>/[^\/]+/, :group_id=>/[a-zA-Z.0-9_\-]+(?<!\.atom)/}
```

2. `parameterize` would strip all Unicode characters, leaving a blank string. Rails would report something like:

ActionView::Template::Error (No route matches {:action=>"show", :controller=>"groups/milestones", :group_id=>#<Group id: 48, name: "ops-dev", path: "ops-dev", owner_id: nil, created_at: "2015-11-15 08:55:30", updated_at: "2015-12-02 06:23:26", type: "Group", description: "", avatar: "sha1.c71e73d51af1865c1bbbf6208e10044d46c9bb93.png", public: false>, :id=>"", :title=>"肯定不是中文的问题"} missing required keys: [:id]):

This change uses the babosa library to create a better slug, which surprisingly
isn't actually used by the global milestone controllers. Instead, they use the
title passed as a query string for some reason.

Closes https://github.com/gitlabhq/gitlabhq/issues/9881

Fix constraints
2015-12-05 00:04:44 -08:00
..
benchmarks Align hash literals in IssuesFinder spec 2015-11-19 16:02:21 +01:00
controllers Fix Error 500 when creating global milestones with Unicode characters 2015-12-05 00:04:44 -08:00
factories Add support for git lfs. 2015-11-16 12:39:13 +01:00
features Merge branch 'master' into ui/form-consistency 2015-12-03 13:21:19 +01:00
finders Port GitLab EE ProjectsFinder changes 2015-11-20 15:53:04 +01:00
fixtures Use URL helpers in specs 2015-12-03 14:00:09 +01:00
helpers Merge branch 'rails_update_to_4_2' into 'master' 2015-11-30 16:49:09 +00:00
javascripts Apply new design to files page 2015-10-13 16:41:48 +02:00
lib Use URL helpers in specs 2015-12-03 14:00:09 +01:00
mailers fix deprecation messages in tests 2015-12-03 10:33:43 +02:00
models Merge branch 'master' into link-refs 2015-12-03 13:32:42 +01:00
requests Merge branch 'extend-events-api' 2015-12-04 13:51:30 +01:00
routing Move partial to right place and fix tests. 2015-09-08 15:14:14 +01:00
services test fix 2015-11-30 18:03:07 +02:00
support Use URL helpers in specs 2015-12-03 14:00:09 +01:00
tasks/gitlab Add lfs to backup specs. 2015-11-19 10:43:45 +01:00
views/help Allow non-admin users to see version information 2015-09-23 17:18:15 -04:00
workers fix specs 2015-11-30 16:12:31 +02:00
factories.rb Improve personal snippet access workflow. Fixes #3258 2015-10-29 18:42:29 -02:00
factories_spec.rb
rails_helper.rb
spec_helper.rb fix notification_service specs 2015-11-30 11:21:10 +02:00
teaspoon_env.rb