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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:02:36+00:00 2026-06-05T21:02:36+00:00

For my test I have the following: test should update holder do holder =

  • 0

For my test I have the following:

test "should update holder" do
        holder = Holder.create(name: "name", user_id: 10)
        put :update, holder: holder
    assert_redirected_to holder_path(assigns(:holder))
end

And when I run them I get the following Error:

  ERROR (0:00:00.185) test_should_update_holder
  No route matches {:holder=>"980190963", :controller=>"holders", :action=>"update"}
        @ /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:532:in `raise_routing_error'
          /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:528:in `rescue in generate'
          /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:520:in `generate'
          /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:561:in `generate'
          /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:557:in `generate_extras'
          /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:553:in `extra_keys'
          /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.3/lib/action_controller/test_case.rb:147:in `assign_parameters'
          /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.3/lib/action_controller/test_case.rb:453:in `process'
          /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.3/lib/action_controller/test_case.rb:49:in `process'
          /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.3/lib/action_controller/test_case.rb:390:in `put'
          test/functional/holders_controller_test.rb:36:in `block in <class:HoldersControllerTest>'
          /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/testing/setup_and_teardown.rb:35:in `block in run'
          /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:458:in `_run__4148286245602197272__setup__4285546581512185515__callbacks'
          /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `__run_callback'
          /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:385:in `_run_setup_callbacks'
          /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in `run_callbacks'
          /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/testing/setup_and_teardown.rb:34:in `run'

But in my routes I have:

Teacherjoy::Application.routes.draw do
  get "users/new"

  resources :questions
  resources :pages
  resources :holders
  resources :users
  resources :sessions, only: [:new, :create, :destroy]
  root :to => 'pages#home'

  match '/signup',  to: 'users#new'
  match '/signin',  to: 'sessions#new'
  match '/signout', to: 'sessions#destroy', via: :delete
end

and rake routes returns:

[teacherjoy (master)]$ rake routes
    users_new GET    /users/new(.:format)          users#new
    questions GET    /questions(.:format)          questions#index
              POST   /questions(.:format)          questions#create
 new_question GET    /questions/new(.:format)      questions#new
edit_question GET    /questions/:id/edit(.:format) questions#edit
     question GET    /questions/:id(.:format)      questions#show
              PUT    /questions/:id(.:format)      questions#update
              DELETE /questions/:id(.:format)      questions#destroy
        pages GET    /pages(.:format)              pages#index
              POST   /pages(.:format)              pages#create
     new_page GET    /pages/new(.:format)          pages#new
    edit_page GET    /pages/:id/edit(.:format)     pages#edit
         page GET    /pages/:id(.:format)          pages#show
              PUT    /pages/:id(.:format)          pages#update
              DELETE /pages/:id(.:format)          pages#destroy
      holders GET    /holders(.:format)            holders#index
              POST   /holders(.:format)            holders#create
   new_holder GET    /holders/new(.:format)        holders#new
  edit_holder GET    /holders/:id/edit(.:format)   holders#edit
       holder GET    /holders/:id(.:format)        holders#show
              PUT    /holders/:id(.:format)        holders#update
              DELETE /holders/:id(.:format)        holders#destroy
        users GET    /users(.:format)              users#index
              POST   /users(.:format)              users#create
     new_user GET    /users/new(.:format)          users#new
    edit_user GET    /users/:id/edit(.:format)     users#edit
         user GET    /users/:id(.:format)          users#show
              PUT    /users/:id(.:format)          users#update
              DELETE /users/:id(.:format)          users#destroy
     sessions POST   /sessions(.:format)           sessions#create
  new_session GET    /sessions/new(.:format)       sessions#new
      session DELETE /sessions/:id(.:format)       sessions#destroy
         root        /                             pages#home
       signup        /signup(.:format)             users#new
       signin        /signin(.:format)             sessions#new
      signout DELETE /signout(.:format)            sessions#destroy

If you look at rake routes, there clearly is a an action for update, which is a put, in the holders controller, which is what my test is doing, right?

  • 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-05T21:02:37+00:00Added an answer on June 5, 2026 at 9:02 pm

    Notice that the route is actually PUT /holders/:id, but you’re passing a :holder option to your put method, not an :id. Try changing that line in your test to this:

    put :update, id: holder
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following spec to test controller method: context #create do it should redirect
I have following code: os.chdir(os.path.dirname(os.path.realpath(__file__)) + /../test) path.append(os.getcwd()) os.chdir(os.path.dirname(os.path.realpath(__file__))) Which should add /../test to
I have the following code require 'test_helper' class ApplicationControllerTest < ActionController::TestCase test should display
I have following databases: test table1 fields: id, password, name, lastname test2 table2 fields:
I have the following test: it should respond with a json object do xhr
When I have the following table: CREATE TABLE test ( id integer NOT NULL,
I have the following code (just as a test) and I want to create
I have following test.pyx cdef public class Foo[object Foo, type FooType]: cdef public char*
I have following test class @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {/services-test-config.xml}) public class MySericeTest { @Autowired
suppose I have following test/ Main.py test/one/ One.py test1.txt test/two/ Two.py test2.txt What I

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.