Skip to content
This repository has been archived by the owner on Mar 14, 2018. It is now read-only.

Commit

Permalink
Purge cache in test after gem add
Browse files Browse the repository at this point in the history
  • Loading branch information
sonalkr132 committed Mar 29, 2016
1 parent dfa69fb commit 61715ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/update/job_spec.rb
Expand Up @@ -5,13 +5,16 @@
require 'bundler_api/update/atomic_counter'
require 'bundler_api/update/job'
require 'bundler_api/web'
require 'bundler_api/cache'

describe BundlerApi::Job do
include Rack::Test::Methods
let(:db) { $db }
let(:builder) { GemBuilder.new(db) }
let(:counter) { BundlerApi::AtomicCounter.new }
let(:mutex) { Mutex.new }
let(:client) { double(:client, purge_path: nil, purge_key: nil) }
let(:cache) { BundlerApi::CacheInvalidator.new(cdn: client) }

def app
BundlerApi::Web.new($db, $db)
Expand Down Expand Up @@ -95,6 +98,8 @@ def dependencies(name, version = "1.0", platform = "ruby")
payload = BundlerApi::GemHelper.new("foo1", Gem::Version.new(version), 'ruby')
job = BundlerApi::Job.new(db, payload, mutex, counter)
job.run
cache.purge_specs
cache.purge_memory_cache('foo1')

get '/info/foo1'
last_response.body
Expand Down

0 comments on commit 61715ce

Please sign in to comment.