0

I upgraded my rails version to 4.1.1 from 4.0.4. Whenever I run rake test I get every test having this error:

ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "roles_users" does not exist
LINE 1: DELETE FROM "roles_users"
                    ^
: DELETE FROM "roles_users"

My user controller has and belongs to many roles

has_and_belongs_to_many :some_names,
  class_name: "Role",
  join_table: "some_names_users"

So it should not be looking for roles_users as a table, but seems to be in the fixtures for my tests.

I am using minitest 5.3.4. I am not using the gem turn.

  • 1
    did you run your migrations, as this looks more like the tables are missing from the DB and not a rails problem – bjhaid May 16 '14 at 21:08
  • 1
    It is the issue described by Dylan below, there's an issue with join_table option not being recognized in 4.1 – thatrailsguy May 19 '14 at 12:46

1 Answers1

1

This is a bug in Rails 4.1; it's already been fixed and I'd expect it to be part of the next release (4.1.2).

In the mean time, you might be able to use the 4-1-stable branch:

gem 'rails', github: 'rails/rails', branch: '4-1-stable'

Github Issues:

Dylan Markow
  • 123,080
  • 26
  • 284
  • 201