Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rake routes not showing right format when nested #18373

Closed
arthurnn opened this issue Jan 6, 2015 · 0 comments · Fixed by #18392
Closed

rake routes not showing right format when nested #18373

arthurnn opened this issue Jan 6, 2015 · 0 comments · Fixed by #18392
Labels

Comments

@arthurnn
Copy link
Member

@arthurnn arthurnn commented Jan 6, 2015

see https://github.com/rubygems/rubygems.org/blob/master/test/functional/dashboards_controller_test.rb#L40-L41

I have a scope constraint for the format, and override that constraint in the resource call.

  scope constraints: {format: :html}, defaults: {format: 'html'} do
    resource  :search,    :only => :show
    resource  :dashboard, :only => :show, constraints: {format: /html|atom/}
  end

That works fine when I test: https://github.com/arthurnn/rubygems.org/blob/fix_atom_ui/test/integration/dashboard_test.rb#L37-L44

  test "dashboard with atom format" do
    rubygem = create(:rubygem, name: "sandworm", number: "1.0.0")
    create(:subscription, rubygem: rubygem, user: @user)

    get dashboard_path(format: :atom)
  end

However when I run rake routes, it returns:

dashboard GET    /dashboard(.:format)             dashboards#show {:format=>"html"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.