Skip to content

Commit

Permalink
[ci] Reset the cache before each rspec suite
Browse files Browse the repository at this point in the history
With things like database_cleaner you really want to make sure that
tests don't pollute each other with stale cache items

(rails defaults to null_store in test environment, but that's a
harsher measure)
  • Loading branch information
coolo committed Jun 29, 2018
1 parent b2581f2 commit f4281e3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/api/spec/rails_helper.rb
Expand Up @@ -69,3 +69,6 @@

# support Delayed Jobs
require 'support/delayed_job'

# Cache reset
require 'support/cache'
6 changes: 6 additions & 0 deletions src/api/spec/support/cache.rb
@@ -0,0 +1,6 @@
# reset the cache before each test
RSpec.configure do |config|
config.before do
Rails.cache.clear
end
end

0 comments on commit f4281e3

Please sign in to comment.