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 4273924
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:46:41+00:00 2026-05-21T07:46:41+00:00

Where to test routes in ruby on rails? unit tests? functional tests? integration tests?

  • 0

Where to test routes in ruby on rails?

  • unit tests?
  • functional tests?
  • integration tests?

Addition:

To be exact, where to apply assertions described on guides and on api?

  • 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-05-21T07:46:41+00:00Added an answer on May 21, 2026 at 7:46 am

    Routes should be done as part of integration tests. Integration tests are where you test the important work flows of your application – more specifically whether a URL is defined or not seems to be an important workflow.

    Your integration test would look like any normal integration test:

    # /tests/integration/routes_test.rb
    require 'test_helper'
    
    class RoutesTest < ActionController::IntegrationTest
      test "route test" do
        assert_generates "/photos/1", { :controller => "photos", :action => "show", :id => "1" }
        assert_generates "/about", :controller => "pages", :action => "about"
      end
    end
    

    As to @jemminger‘s response of not testing routes – While it is Rail’s tests that verify that routes.rb works, it’s not Rail’s responsibility to test whether http://yoursite.com/users is defined in your routes. The caveat is that most route testing could be done in existing integration tests, so specific tests for routes could be redundant.

    The specific use case I can think of are all the people that have already, or are going to upgrade from Rails 2 to Rails 3. The code to define routes has changed significantly, and it’s better to find out from tests that the routes were upgraded correctly, than from users when they report 404 errors.

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

Sidebar

Related Questions

Our test department has a series of web tests created using Visual Studio 2005
I am running Ruby on Rails 3 and I would like to set up
I am running Ruby on Rails 3 and I would like to use URLs
I am using Rails 3.0.1, Bundler 1.0.3 and Ruby 1.9.2p0 (2010-08-18 revision 29036). Everything
I have an Ruby on Rails 3 admin_controller with the default set of CRUD,
Test Driven Development has been the rage in the .NET community for the last
Test the following code: #include <stdio.h> #include <stdlib.h> main() { const char *yytext=0; const
After test driving Google Chrome for 30 minutes or so, I like it, even
Our Test DB is suddenly missing rows. We want them back. Is there a
The test driven development guys refer to a quick, exploratory, investigation that involves coding

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.