Skip to content

Commit

Permalink
Adapt testing setup
Browse files Browse the repository at this point in the history
adapt rails_helper and is called in .rspec
  • Loading branch information
henrixapp committed Dec 11, 2020
1 parent 00c4450 commit 9c1fb96
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
--color
--require spec_helper
--require rails_helper
--format documentation
9 changes: 9 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,19 @@ For more information visit [cypress-documentation](https://docs.cypress.io) and

## In docker development container

Start the development version as usual. All commands are executed
in `docker/development`

Make sure that the seperate test db exist:

```sh
docker-compose exec mampf sh -c "RAILS_ENV=test rails db:create"
docker-compose exec mampf sh -c "RAILS_ENV=test rails db:migrate"
docker-compose exec mampf sh -c "RAILS_ENV=test rails db:test:prepare"
```

Now you can run the tests:

```sh
docker-compose exec mampf sh -c "RAILS_ENV=test rails spec"
```
2 changes: 1 addition & 1 deletion config/sunspot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ test:
hostname: <%= ENV.fetch('SOLR_HOST', 'solr') %>
port: <%= ENV.fetch('SOLR_PORT', '8983') %>
log_level: WARNING
path: <%= ENV.fetch('SOLR_PATH', '/solr/test') %>
path: <%= ENV.fetch('SOLR_TEST_PATH', '/solr/test') %>

1 change: 0 additions & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is copied to spec/ when you run 'rails generate rspec:install'
require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ENV['RAILS_ENV'] ||= 'test'
#simplecov

require 'simplecov'
Expand Down

0 comments on commit 9c1fb96

Please sign in to comment.