diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-10-06 18:23:53 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-10-06 18:23:53 +0900 |
commit | 638c616296b37b528c1b56f63a818301a502f7aa (patch) | |
tree | f58194566e84063584983a0e8f48d39f3e90bd50 /spec | |
parent | 354e2ef08df3c704ca325415116587440260f67b (diff) | |
download | gitlab-ce-638c616296b37b528c1b56f63a818301a502f7aa.tar.gz |
Use utc for time comparision
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/google_api/cloud_platform/client_spec.rb | 4 | ||||
-rw-r--r-- | spec/workers/wait_for_cluster_creation_worker_spec.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/spec/lib/google_api/cloud_platform/client_spec.rb b/spec/lib/google_api/cloud_platform/client_spec.rb index 6b454a593a0..6538dc21d6f 100644 --- a/spec/lib/google_api/cloud_platform/client_spec.rb +++ b/spec/lib/google_api/cloud_platform/client_spec.rb @@ -7,7 +7,7 @@ describe GoogleApi::CloudPlatform::Client do describe '#validate_token' do subject { client.validate_token(expires_at) } - let(:expires_at) { 1.hour.since.strftime('%s') } + let(:expires_at) { 1.hour.since.utc.strftime('%s') } context 'when token is nil' do let(:token) { nil } @@ -26,7 +26,7 @@ describe GoogleApi::CloudPlatform::Client do end context 'when expires in 10 minutes' do - let(:expires_at) { 5.minutes.since.strftime('%s') } + let(:expires_at) { 5.minutes.since.utc.strftime('%s') } it { is_expected.to be_falsy } end diff --git a/spec/workers/wait_for_cluster_creation_worker_spec.rb b/spec/workers/wait_for_cluster_creation_worker_spec.rb index 6d82981287f..dcd4a3b9aec 100644 --- a/spec/workers/wait_for_cluster_creation_worker_spec.rb +++ b/spec/workers/wait_for_cluster_creation_worker_spec.rb @@ -24,7 +24,7 @@ describe WaitForClusterCreationWorker do context 'when operation timeout' do before do - allow(operation).to receive(:start_time).and_return(30.minutes.ago) + allow(operation).to receive(:start_time).and_return(30.minutes.ago.utc) end it 'sets an error message on cluster' do |