Skip to content

Commit

Permalink
Run DatabaseCleaner before RSpec tests (#539)
Browse files Browse the repository at this point in the history
* Rename workflow

* Run DatabaseCleaner before RSpec tests

* Run on all pushes
  • Loading branch information
tsujigiri authored Jul 25, 2022
1 parent 41e4056 commit 58cd495
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/test.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
name: Ruby

on:
push:
branches: [ master ]
push: {}
pull_request:
branches: [ master ]
branches: [master]

jobs:
test:
tests:
runs-on: ubuntu-latest
services:
postgres:
Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@

config.infer_spec_type_from_file_location!

config.before(:suite) do
DatabaseCleaner.clean_with(:truncation, except: %w(achievements))
end

config.before(:example) do
DatabaseCleaner.strategy = :transaction
end
Expand Down

0 comments on commit 58cd495

Please sign in to comment.