Ask A Question

Notifications

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 6.0.3.1 and it fails with a simple test:

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

/tmp/app-test $ rails new .
       exist
      create  README.md
      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
  end
end
/tmp/app-test $ rake test
Run options: --seed 62884

# Running:

E

Error:
StartpageTest#test_start_page:
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?

Reply
Join the discussion
Create an account Log in

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

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

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