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

The Archive Base Latest Questions

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

I have a simple Rails 3 app: no models, one view and one controller

  • 0

I have a simple Rails 3 app: no models, one view and one controller with a single index method which produces static content. It works fine: when I manually browse to '/' I see my static content.

Then I added an integration test:

# myproj/test/integration/routes_test.rb
class RoutesTest < ActionController::IntegrationTest
  test 'default_route' do
    get '/'
    assert_response :success, @response.body
  end
end

When running this test via rake, it tells me that GET '/' is responding with 500. Examination of the log output reveals this message in the response body:

A secret is required to generate an integrity hash for cookie session
data. Use config.secret_token = "some secret phrase of at least 30
characters" in config/initializers/secret_token.rb

Of course secret_token.rb exists and contains a properly formatted secret (it was generated by Rails 3 itself.)

Anyone out there know how to enable integration testing in Rails 3? I’m guessing perhaps I need to set some other configuration options to tell my app to accept integration tests.

  • 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:38:42+00:00Added an answer on May 21, 2026 at 7:38 am

    You need to include the Rails-generated file test_helper.rb. This contains the magic necessary to allow integration testing.

    In your test file(s), prepend the line:

    require File.join( File.dirname( __FILE__ ), '../test_helper.rb' )
    

    The path '../test_helper.rb' above should be relative to the test file that includes it.

    FYI: The above is a Ruby idiom for including files by with relative paths (like #include "../foo.h" in C.) If you’re using Ruby 1.9.x, you can use a simpler form:

    require_relative '../test_helper.rb'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

for example a have simple rails app with two models, users and books. now
I am using Single-Table Inheritance (STI) on one of my models for a Rails
I have a really simple Rails app. Basically an article with comments. I want
I have been struggling to get a simple autocomplete working with my Rails app
Hallo I'm new to Rails and have one simple question. I'm using radiant as
I have a simple little test app written in Flex 3 (MXML and some
I have a simple setter method for a property and null is not appropriate
I am trying to sending XML content through POST to a controller ('Parse') method
I made a tweet scaffold(controllers, models,views,..) in my Rails 3 app and among all
I have simple regex \.*\ for me its says select everything between and ,

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.