Commit 7794c857 authored by James Lopez's avatar James Lopez

Merge branch 'ce-to-ee-2018-01-07' into 'master'

CE upstream - Sunday

See merge request gitlab-org/gitlab-ee!3953
parents d95592d1 dc073212
......@@ -6,6 +6,7 @@ class CheckGcpProjectBillingWorker
LEASE_TIMEOUT = 15.seconds.to_i
SESSION_KEY_TIMEOUT = 5.minutes
BILLING_TIMEOUT = 1.hour
def self.get_session_token(token_key)
Gitlab::Redis::SharedState.with do |redis|
......@@ -34,7 +35,9 @@ class CheckGcpProjectBillingWorker
billing_enabled_projects = CheckGcpProjectBillingService.new.execute(token)
Gitlab::Redis::SharedState.with do |redis|
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)
end
end
......
......@@ -87,7 +87,7 @@ feature 'Gcp Cluster', :js do
end
it 'user sees a cluster details page' do
expect(page).to have_button('Save')
expect(page).to have_button('Save changes')
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,7 @@ 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)
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)
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