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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:54:27+00:00 2026-05-25T21:54:27+00:00

Looking at the Rails Guides http://guides.rubyonrails.org/testing.html#integration-testing-examples and this SO question Rails Functional Test of

  • 0

Looking at the Rails Guides http://guides.rubyonrails.org/testing.html#integration-testing-examples and this SO question Rails Functional Test of Arbitrary or Custom URLs, the following should work in a test:

require 'test_helper'
class ApplicationControllerTest < ActionController::TestCase
  test "test authentication" do
    get "/dash"
    assert_response :success
  end
end

But I get an error: ActionController::RoutingError: No route matches {:controller=>"application", :action=>"/dash"}

My route is set up and works at the following URL: http://localhost:3000/dash

This is the route:

dash     /dash(.:format)   {:action=>"population", :controller=>"dashboard"}

Why wouldn’t a get with a URL work?

I am running this test from class ApplicationControllerTest < ActionController::TestCase, which is different from dashboard controller. Do you have to run it from the functional test of the same name as the controller?

Working in Rails 3.07 using Test::Unit.

  • 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-25T21:54:28+00:00Added an answer on May 25, 2026 at 9:54 pm

    Yes, you do have to run it from the functional test for that particular controller. Rails is trying to be helpful, so it automatically picks what controller it sends the request to based on the test class’s name.

    You’ll probably also need to heed Marian’s advice and use the action name rather than the URL:

    get :population
    

    And note that the get / post / etc. helper functions behave completely differently in integration tests (I believe your code would be correct there) – that’s probably where you’re getting hung up. I find this inconsistency irritating as well…

    Hope that helps!

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

Sidebar

Related Questions

Rails has beautiful documentation on their guides and their website: http://guides.rubyonrails.org/association_basics.html I am taking
Looking for a Rails validation that will only allow letters, numbers, and spaces. This
I'm currently looking at a hefty Rails test suite. It's nothing I can get
I'm looking at Rails development as a backend to a Flex application and am
When I first started looking into Rails and Django I was steered away from
I'm looking for some Rails/Facebook functionality that has already been built - as a
I'm looking for a rails plugin/gem which brings the functionality of marking an ActiveRecord-Model
i'm looking for a rails plugin for open id authentication. I'm using restful-authentication Can
I'm looking at building a Rails application which will have some pretty large tables
I am looking for recommendations on the best Rails plugins and gems for parsing

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.