Skip to content

Commit 7747455

Browse files
committed
Fix "Could not find table 'users'" during tests
Setting the RAILS_ENV to test ensures that the Rails test setup happens as expected, loading the schema into the test database before the tests are run. This fixes a problem where the tests would fail with this message if `bundle exec rake test` is run on a fresh checkout: ActiveRecord::StatementInvalid: Could not find table 'users'
1 parent fbce97a commit 7747455

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/test_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ENV['RAILS_ENV'] ||= 'test'
2+
13
require 'timecop'
24
require 'diffy'
35
require 'nokogiri'

0 commit comments

Comments
 (0)