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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:53:31+00:00 2026-05-20T12:53:31+00:00

I create all the routes of my program manually and so do with my

  • 0

I create all the routes of my program manually and so do with my rspec tests of course. Generally, my routes and tests work fine, but i have a problem with the test for my characters controller. The route is :

  scope :path => '/characters', :controller => :characters do
    get '/' => :show, :as => 'user_character'
  end  

The /characters works fine when tested with my browser. Everything seems fine. But, the test :

require 'spec_helper'
require 'devise/test_helpers'

describe CharactersController do
    login_user

    describe "when it GETS 'show'" do
        it "should render the template and be successful" do
            get :show
            response.should render_template(:show)
            response.should be_success
        end
    end

end

Fails with the error :

  1) CharactersController when it GETS 'show' should render the template and be successful
     Failure/Error: get :show
     ActionController::RoutingError:
       No route matches {:controller=>"characters", :action=>"show"}
     # ./spec/controllers/characters_controller_spec.rb:9

All my controllers have similar tests that work fine. Why does this not work ?

IMPORTANT EDIT :

Just saw that if i turn Spork off, the test passes ! Why is this happening ? Does Spork need to be restarted every time a new test is added ?

  • 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-20T12:53:31+00:00Added an answer on May 20, 2026 at 12:53 pm

    You have to restart spork when changing routes.

    Or put this in your spec_helper.rb:

    Spork.each_run do
      ApplicationName::Application.reload_routes!
    end
    

    See also “Speedy Test Iterations for Rails 3 with Spork and Guard”

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

Sidebar

Related Questions

I want something like this in my routes.rb. This isn't at all correct, but
The intention is to create a subdomain to hold all the administrative function (CRUD)
I have routes that are being registered from the database into an asp.net website
I am trying to create a comment that could comment on other comments but
Here’s the situation: We have a 3rd party application that intermittently displays an error
I am writing a Qt program (4.7 for windows 7 initially) that requires writing
I am trying to store custom routes for the Zend Framework inside the database.
I would like to create a custom CMS within Codeigniter, and I need a
I posted Python find first network hop about trying to find the first hop
This irritates me right now, and I've been at it for more than an

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.