title: Rake cannot run Rspec specs in Docker/Rails/Postgres setup (but web app works fine)
body: <p>Is there a special step or configuration needed to get Rails (3.2.21) test database (eg, Rspec specs) working under Docker when using the Heroku-docker solution?</p>
  
  <p>I'm using Docker Toolkit (the Docker Quickstart Terminal) to run my Heroku app locally, and everything <em>except</em> running specs is working.</p>
  
  <p>This works:</p>
  
  <pre><code>docker-compose run web rake db:reset
  </code></pre>
  
  <p>And the web app works, reading and writing the database with all seed value loaded.</p>
  
  <p>However any command to create or use the test database fails:</p>
  
  <pre><code>docker-compose run web rake db:test:prepare
  docker-compose run web rake db:test:load    
  docker-compose run web rake spec
  docker-compose run web bundle exec rake spec
  </code></pre>
  
  <p>all throw the error:</p>
  
  <pre><code>PG::ConnectionBad: FATAL: role "root" does not exist
  </code></pre>
  
  <p>I'm using the Heroku postgres image, with an app.json that looks like:</p>
  
  <pre><code>{
    "name": "My App",
    "description": "Localized Docker Setup",
    "image": "hrails200",
    "addons": [
      "heroku-postgresql"
    ]
  }
  </code></pre>
  
  <p><em>(hrails200 is the heroku/ruby image modified to use Ruby 2.0.0)</em></p>
  
  <p>and the docker-compose.yml file ends with:</p>
  
  <pre><code>herokuPostgresql:
    image: postgres
  </code></pre>
  
  <p>and the web and worker have a links entry pointing to Postgres:</p>
  
  <pre><code>  links:
      - herokuPostgresql
  </code></pre>
  
  <p>My config/database.yml looks like:</p>
  
  <pre><code>default: &amp;default
    adapter: postgresql
    encoding: unicode
    pool: 5
  
  development:
    &lt;&lt;: *default
    database: docker_mondo_dev
  
  test:
    &lt;&lt;: *default
    database: docker_mondo_test
  </code></pre>