Skip to content

Commit 464436e

Browse files
committed
Fix make test command
We should be using the test database, otherwise we'll get all kind of errors.
1 parent 4559000 commit 464436e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ shell: ## Open a shell in the web container
2121
console: ## Open Rails console in the web container
2222
$(COMPOSE) exec web bin/rails console
2323

24-
test: ## Run RSpec in the web container
25-
$(COMPOSE) exec web bundle exec rspec
24+
test: ## Run RSpec in the web container (uses test database)
25+
$(COMPOSE) exec -e RAILS_ENV=test -e DATABASE_URL=postgresql://hackorum:hackorum@db:5432/hackorum_test web bin/rails db:prepare
26+
$(COMPOSE) exec -e RAILS_ENV=test -e DATABASE_URL=postgresql://hackorum:hackorum@db:5432/hackorum_test web bundle exec rspec
2627

2728
db-migrate: ## Run db:migrate
2829
$(COMPOSE) exec web bin/rails db:migrate

0 commit comments

Comments
 (0)