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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:14:28+00:00 2026-06-17T21:14:28+00:00

I want to test every route in an application, and learned I should do

  • 0

I want to test every route in an application, and learned I should do that in an integration test: Where to test routes in ruby on rails

However I’m getting the following error:

NoMethodError: undefined method `authenticate?' for nil:NilClass
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/devise-2.1.2/lib/devise/rails/routes.rb:286:in `block in authenticated'

It’s well-mentioned online that you can’t use Devise::TestHelpers in integration testing —
Devise Google Group,
Devise Github page


How can I test routes like the following?

# config/routes.rb

devise_for :users

authenticated :user do
  root to: 'static#home'
end

root to: 'static#landing'

I am running test unit tests with $ rake test:integration

  • 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-17T21:14:30+00:00Added an answer on June 17, 2026 at 9:14 pm

    Integration tests are important for your application work flow. They can tell about your URL definition more clearly.

    Check the post by nicholaides, that explains the cause of this error and the solution in Authenticated routes.

    Still the problem is:

    Devise has its own methods and you can’t use Devise::TestHelpers in ruby. So how can you test? Well you need to include the Devise::TestHelpers somehow.

    Well, if you’re using RSpec, you can put the following inside a file named spec/support/devise.rb:

    RSpec.configure do |config|
      config.include Devise::TestHelpers, :type => :controller
    end
    

    This is specified here.

    But wait………. Again, you can run into this same issue with Test::Unit.

    Then?

    So, you just need to add the devise test helpers to test/test_helper.rb.

    class ActiveSupport::TestCase
      include Devise::TestHelpers
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to test the age of a user of my Rails application using
I am developing Blackberry application. Every time when i want to test my app
I want to debug my tests, to examine every test to see where exactly
I want to test Add new item activity in my application. When user fills
I want to test the following code: private bool TestException(Exception ex) { if ((Marshal.GetHRForException(ex)
Currently I have to create a parameterized test class for every method that I
I want to test my application on older iOS versions. I am using weak
I don't want to compile my app every-time I want to test it in
Let's say I want to test a simple helper that takes a class name
I want to cleanup the database after every test case without rolling back the

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.