ruby - postgresql_adapter async_exec error on rails rspec test using Capybara + FactoryGirl -


i'm getting strange error when try run test in rails:

postgresql_adapter.rb:592:in `async_exec': pg::undefinedtable: error:  relation "users" not exist (activerecord::statementinvalid) 

i don't know if helps spec_helper.rb file looks this:

require 'rubygems' env["rails_env"] ||= 'test' require file.expand_path("../../config/environment", __file__) require 'rspec/rails' require 'factory_girl_rails' require 'database_cleaner' require 'capybara/rails' require 'capybara/rspec' require 'capybara/poltergeist'   require 'support/mailer_macros' require 'support/test_helper' require 'support/factory_girl_helper'  activerecord::migration.check_pending! if defined?(activerecord::migration)  capybara.register_driver :poltergeist |app|   capybara::poltergeist::driver.new app, window_size: [1600, 1200], js_errors: false end  rspec.configure |config|   config.use_transactional_fixtures = false    config.include(factorygirlhelper)   config.include(mailermacros)   config.include(testhelper)   config.before(:each) { reset_email }    config.expect_with :rspec |c|     c.syntax = [:should, :expect]   end    capybara.javascript_driver = :poltergeist   config.include capybara::dsl    config.before(:suite)     databasecleaner.clean_with(:truncation) # moving before :each doesn't     databasecleaner.strategy = :truncation # moving before :each doesn't   end    config.around :each |example| # refactoring before/after .start/.clean doesn't     databasecleaner.cleaning { example.run }   end end 

anyone has idea why happening? application in browser seems working fine.

sounds schema test db out of sync, either need run migrations on or reset/recreate it.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -