title: rails test files while using postgresql
body: <p>I've got a little problem with RoR and PostgreSQL. When I'm using this database, can't make any test. Always is the same problem. Tried to copy Bundle from other project, but didn't help. It's quite important to do tests in this app. Thanks from advance!</p>
  
  <p>My Gemfile:</p>
  
  <pre><code>    source 'https://rubygems.org'
      # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
      gem 'rails', '~&gt; 5.1.1'
      # Use postgresql as the database for Active Record
      gem 'pg', '~&gt; 0.18'
      # Use Puma as the app server
      gem 'puma', '~&gt; 3.7'
      # Use SCSS for stylesheets
      gem 'sass-rails', '~&gt; 5.0'
      # Use Uglifier as compressor for JavaScript assets
      gem 'uglifier', '&gt;= 1.3.0'
      # See https://github.com/rails/execjs#readme for more supported runtimes
      # gem 'therubyracer', platforms: :ruby
  
      # Use CoffeeScript for .coffee assets and views
      gem 'coffee-rails', '~&gt; 4.2'
      # Turbolinks makes navigating your web application faster. Read more:         https://github.com/turbolinks/turbolinks
      gem 'turbolinks', '~&gt; 5'
      # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
      gem 'jbuilder', '~&gt; 2.5'
      # Use Redis adapter to run Action Cable in production
      # gem 'redis', '~&gt; 3.0'
      # Use ActiveModel has_secure_password
      # gem 'bcrypt', '~&gt; 3.1.7'
  
      # Use Capistrano for deployment
      # gem 'capistrano-rails', group: :development
  
      group :development, :test do
        # Call 'byebug' anywhere in the code to stop execution and get a         debugger console
        gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
        # Adds support for Capybara system testing and selenium driver
        gem 'capybara', '~&gt; 2.13'
        gem 'selenium-webdriver'
        gem 'rails-controller-testing'
        gem 'sqlite3'
      end
  
      group :development do
       # Access an IRB console on exception pages or by using &lt;%= console %&gt; anywhere in the code. gem 'web-console', '&gt;= 3.3.0' gem 'listen', '&gt;= 3.0.5', '&lt; 3.2' 
     # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 
     gem 'spring'
     gem 'spring-watcher-listen', '~&gt; 2.0.0' 
     gem 'bootstrap-sass' 
     end 
     gem 'bcrypt' 
     # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', 
      platforms: [:mingw, :mswin, :x64_mingw, :jruby]
  </code></pre>
  
  <p>And answer from console:</p>
  
  <pre><code>    igor@igor:~/PWr/RubyProjects/Delegation$ rails test
      /var/lib/gems/2.3.0/gems/actionpack-5.1.1/lib/action_dispatch /middleware/session/abstract_store.rb:78:in `&lt;module:Session&gt;': uninitialized constant Rack::Session::Abstract::Persisted (NameError)
  from /var/lib/gems/2.3.0/gems/actionpack-5.1.1/lib/action_dispatch/middleware/session/abstract_store.rb:8:in `&lt;module:ActionDispatch&gt;'
  from /var/lib/gems/2.3.0/gems/actionpack-5.1.1/lib/action_dispatch/middleware/session/abstract_store.rb:7:in `&lt;top (required)&gt;'
  from /var/lib/gems/2.3.0/gems/actionpack-5.1.1/lib/action_dispatch/middleware/session/cookie_store.rb:2:in `&lt;top (required)&gt;'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/application/configuration.rb:180:in `const_get'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/application/configuration.rb:180:in `session_store'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/application/default_middleware_stack.rb:56:in `block in build_stack'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/application/default_middleware_stack.rb:13:in `tap'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/application/default_middleware_stack.rb:13:in `build_stack'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/application.rb:501:in `default_middleware_stack'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/engine.rb:506:in `block in app'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/engine.rb:504:in `synchronize'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/engine.rb:504:in `app'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/application/finisher.rb:45:in `block in &lt;module:Finisher&gt;'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/initializable.rb:30:in `instance_exec'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/initializable.rb:30:in `run'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/initializable.rb:59:in `block in run_initializers'
  from /usr/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
  from /usr/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
  from /usr/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
  from /usr/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
  from /usr/lib/ruby/2.3.0/tsort.rb:347:in `each'
  from /usr/lib/ruby/2.3.0/tsort.rb:347:in `call'
  from /usr/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
  from /usr/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
  from /usr/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/initializable.rb:58:in `run_initializers'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/application.rb:353:in `initialize!'
  from /home/igor/PWr/RubyProjects/Delegation/config/environment.rb:5:in `&lt;top (required)&gt;'
  from /home/igor/PWr/RubyProjects/Delegation/test/test_helper.rb:1:in `require'
  from /home/igor/PWr/RubyProjects/Delegation/test/test_helper.rb:1:in `&lt;top (required)&gt;'
  from /home/igor/PWr/RubyProjects/Delegation/test/controllers/static_pages_controller_test.rb:1:in `require'
  from /home/igor/PWr/RubyProjects/Delegation/test/controllers/static_pages_controller_test.rb:1:in `&lt;top (required)&gt;'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/test_unit/test_requirer.rb:14:in `require'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/test_unit/test_requirer.rb:14:in `block in require_files'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/test_unit/test_requirer.rb:13:in `each'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/test_unit/test_requirer.rb:13:in `require_files'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/test_unit/minitest_plugin.rb:94:in `plugin_rails_init'
  from /var/lib/gems/2.3.0/gems/minitest-5.10.2/lib/minitest.rb:81:in `block in init_plugins'
  from /var/lib/gems/2.3.0/gems/minitest-5.10.2/lib/minitest.rb:79:in `each'
  from /var/lib/gems/2.3.0/gems/minitest-5.10.2/lib/minitest.rb:79:in `init_plugins'
  from /var/lib/gems/2.3.0/gems/minitest-5.10.2/lib/minitest.rb:130:in `run'
  from /var/lib/gems/2.3.0/gems/railties-5.1.1/lib/rails/test_unit/minitest_plugin.rb:77:in `run'
  from /var/lib/gems/2.3.0/gems/minitest-5.10.2/lib/minitest.rb:63:in `block in autorun'
  </code></pre>