Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8765373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:15:48+00:00 2026-06-13T16:15:48+00:00

I have a test in my functional test which asserts the redirect after a

  • 0

I have a test in my functional test which asserts the redirect after a remove is correct:

assert_redirected_to terrain_tip_url(terrain_id: entities(:deroos))

This should result in testing whether the url is: http://test.host/terrains/:terrain_id/tips and in the application that is the exact url that is generated. However, in the test case this results in the url being: http://test.host/terrains/:terrain_id/tips/:id, which results in a failing test case:

Expected response to be a redirect to <http://test.host/terrains/446801721/tips/495319887> but was a redirect to <http://test.host/terrains/446801721/tips>

Why does the terrain_tip_url include an id parameter that I never set? How can I prevent this from happening?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:15:50+00:00Added an answer on June 13, 2026 at 4:15 pm

    Running rake routes should give you some insight here. I believe what you want is terrain_tips_url (index), not terrain_tip_url (show).

    http://guides.rubyonrails.org/routing.html#crud-verbs-and-actions

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a JUnit test for a private function which is returning String.
I have recently completed a detailed investigation regarding GP functional test automation possibilities with
I have some test class TestKlass = (function() { function TestKlass(value) { this.value =
I have just come across this code: function test(){ //... if ( $profilerule ==
In my (Rails 3.2) Test::Unit controller/functional tests, assert_routing is failing with this error: 1)
I have a method in a service which I want to test. That method
I have a simple unit test which tests that a validation function picks up
I have a unit test fixture in which I'm trying to test a ControllerAction
I have a function that returns an anonymous type which I want to test
Looking at the Rails Guides http://guides.rubyonrails.org/testing.html#integration-testing-examples and this SO question Rails Functional Test of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.