Commit 40dfdd30 authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-01-07

# Conflicts:
#	app/workers/check_gcp_project_billing_worker.rb
#	spec/features/projects/clusters/gcp_spec.rb
#	spec/workers/check_gcp_project_billing_worker_spec.rb

[ci skip]
parents d95592d1 2c66b942
......@@ -6,6 +6,10 @@ class CheckGcpProjectBillingWorker
LEASE_TIMEOUT = 15.seconds.to_i
SESSION_KEY_TIMEOUT = 5.minutes
<<<<<<< HEAD
=======
BILLING_TIMEOUT = 1.hour
>>>>>>> upstream/master
def self.get_session_token(token_key)
Gitlab::Redis::SharedState.with do |redis|
......@@ -34,7 +38,13 @@ class CheckGcpProjectBillingWorker
billing_enabled_projects = CheckGcpProjectBillingService.new.execute(token)
Gitlab::Redis::SharedState.with do |redis|
<<<<<<< HEAD
redis.set(self.class.redis_shared_state_key_for(token), !billing_enabled_projects.empty?)
=======
redis.set(self.class.redis_shared_state_key_for(token),
!billing_enabled_projects.empty?,
ex: BILLING_TIMEOUT)
>>>>>>> upstream/master
end
end
......
......@@ -87,7 +87,11 @@ feature 'Gcp Cluster', :js do
end
it 'user sees a cluster details page' do
<<<<<<< HEAD
expect(page).to have_button('Save')
=======
expect(page).to have_button('Save changes')
>>>>>>> upstream/master
expect(page.find(:css, '.cluster-name').value).to eq(cluster.name)
end
......
......@@ -77,4 +77,18 @@ feature 'Clusters', :js do
end
end
end
context 'when user has not signed in Google' do
before do
visit project_clusters_path(project)
click_link 'Add cluster'
click_link 'Create on GKE'
end
it 'user sees a login page' do
expect(page).to have_css('.signin-with-google')
expect(page).to have_link('Google account')
end
end
end
......@@ -27,7 +27,11 @@ describe CheckGcpProjectBillingWorker do
expect(CheckGcpProjectBillingService).to receive_message_chain(:new, :execute).and_return([double])
expect(Gitlab::Redis::SharedState).to receive(:with).and_yield(redis_double)
<<<<<<< HEAD
expect(redis_double).to receive(:set).with(described_class.redis_shared_state_key_for(token), anything)
=======
expect(redis_double).to receive(:set).with(described_class.redis_shared_state_key_for(token), anything, anything)
>>>>>>> upstream/master
subject
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment