86f4767dc1
================== = Implementation = ================== 1. The path of the page is of the form 'group/project/pages/domains/<domain_name>' 2. Rails looks at `params[:id]` (which should be the domain name), and finds the relevant model record. 3. Given a domain like `foo.bar`, Rails sets `params[:id]` to `foo` (should be `foo.bar`), and sets `params[:format]` to `bar` 4. This commit fixes the issue by adding a route constraint, so that `params[:id]` is set to the entire `foo.bar` domain name. ========= = Tests = ========= 1. Add controller specs for the `PagesDomainController`. These are slightly orthogonal to this bug fix (they don't fail when this bug is present), but should be present nonetheless. 2. Add routing specs that catch this bug (by asserting that the `id` param is passed as expected when it contains a domain name). 3. Modify the 'RESTful project resources' routing spec shared example to accomodate controllers where the controller path (such as `pages/domains`) is different from the controller name (such as `pages_domains`). |
||
---|---|---|
.. | ||
admin | ||
ci | ||
dashboard | ||
explore | ||
groups | ||
import | ||
oauth | ||
profiles | ||
projects | ||
abuse_reports_controller_spec.rb | ||
application_controller_spec.rb | ||
autocomplete_controller_spec.rb | ||
blob_controller_spec.rb | ||
groups_controller_spec.rb | ||
health_check_controller_spec.rb | ||
help_controller_spec.rb | ||
invites_controller_spec.rb | ||
notification_settings_controller_spec.rb | ||
projects_controller_spec.rb | ||
registrations_controller_spec.rb | ||
root_controller_spec.rb | ||
search_controller_spec.rb | ||
sent_notifications_controller_spec.rb | ||
sessions_controller_spec.rb | ||
snippets_controller_spec.rb | ||
uploads_controller_spec.rb | ||
users_controller_spec.rb |