# RSpec tests won't pass on discourse\_dev docker image

**URL:** <https://meta.discourse.org/t/rspec-tests-wont-pass-on-discourse-dev-docker-image/59515>\
**Category:** Development\
**Created:** [March 20, 2017, 3:42am UTC](https://meta.discourse.org/t/rspec-tests-wont-pass-on-discourse-dev-docker-image/59515 "2017-03-20T03:42:01Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![LeoMcA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leomca/32/87233_2.png) [@LeoMcA](https://meta.discourse.org/u/LeoMcA)\
**Post date:** [April 26, 2017, 4:23pm UTC](https://meta.discourse.org/t/rspec-tests-wont-pass-on-discourse-dev-docker-image/59515/5 "2017-04-26T16:23:19Z")

</div>

This is still an issue, but this got it working, cheers!

Just a note to anybody else affected out there, this didn’t work on my first attempt and I _think_ it’s because I don’t allow non-root to run docker, so the `RAILS_ENV=test` wasn’t getting passed through sudo.

So if you’re like me, use this to drop, create and migrate the db instead:

```plaintext
sudo d/shell
cd /src
RAILS_ENV=test rake db:drop db:create db:migrate

```

---

_[View the full topic](https://meta.discourse.org/t/rspec-tests-wont-pass-on-discourse-dev-docker-image/59515)._
