All threads / Simple Test with empty rails fails
Ask A Question


You’re not receiving notifications from this thread.

Simple Test with empty rails fails

Andreas Steinel asked in Testing

Hi everyone,

I'm currently trying to create a template for internal Rails development and I just tried the newest Rails and it fails with a simple test:

/tmp $ mkdir app-test
/tmp $ cd app-test
/tmp/app-test $ rails --version

/tmp/app-test $ rails new .
      create  Rakefile
/tmp/app-test $ rake db:migrate
/tmp/app-test $ cat test/integration/startpage_test.rb
# frozen_string_literal: true

require 'test_helper'

class StartpageTest < ActionDispatch::IntegrationTest
  test 'start page' do
    get '/'
    assert_response :success
/tmp/app-test $ rake test
Run options: --seed 62884

# Running:


DRb::DRbRemoteError: Expected response to be a <2XX: success>, but was a <403: Forbidden> (Minitest::Assertion)
    test/integration/startpage_test.rb:8:in `block in <class:StartpageTest>'

rails test test/integration/startpage_test.rb:6

Finished in 0.570293s, 1.7535 runs/s, 1.7535 assertions/s.
1 runs, 1 assertions, 0 failures, 1 errors, 0 skips

If I run the app, I can view the default rails landing page on an empty setup. It also does not work if I create a new controller rendering inline test with corresponding route entry. I used this kind of test before without any problems.

Any ideas what's wrong here or how I can debug this?

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 68,099+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.