diff options
author | Matija Čupić <matteeyah@gmail.com> | 2017-12-16 02:39:55 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2017-12-16 04:00:35 +0100 |
commit | 68b95cd01e674cd2dbce45c49f5be04c223b718d (patch) | |
tree | 1ddfc864b13c2b411009fef628af5eb98352fc1e /spec | |
parent | 291480f5e17fea424692f979db91d2ec62d24dbd (diff) | |
download | gitlab-ce-68b95cd01e674cd2dbce45c49f5be04c223b718d.tar.gz |
Add CheckGcpProjectBillingWorker
Diffstat (limited to 'spec')
-rw-r--r-- | spec/workers/check_gcp_project_billing_worker_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/workers/check_gcp_project_billing_worker_spec.rb b/spec/workers/check_gcp_project_billing_worker_spec.rb new file mode 100644 index 00000000000..c6e624f65be --- /dev/null +++ b/spec/workers/check_gcp_project_billing_worker_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +describe CheckGcpProjectBillingWorker do + describe '.perform' do + let(:token) { 'bogustoken' } + subject { described_class.new.perform(token) } + + it 'calls the service' do + expect(CheckGcpProjectBillingService).to receive_message_chain(:new, :execute) + + subject + end + + it 'stores billing status in redis' do + expect(CheckGcpProjectBillingService).to receive_message_chain(:new, :execute).and_return(true) + subject + + Gitlab::Redis::SharedState.with do |redis| + expect(redis.get("gitlab:gcp:#{token}:billing_enabled")).to eq('true') + end + end + end +end |