Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/api/users_spec.rb')
-rw-r--r--spec/requests/api/users_spec.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb
index c554463df76..040ac4f74a7 100644
--- a/spec/requests/api/users_spec.rb
+++ b/spec/requests/api/users_spec.rb
@@ -1679,13 +1679,13 @@ RSpec.describe API::Users do
end
it 'creates SSH key with `expires_at` attribute' do
- optional_attributes = { expires_at: '2016-01-21T00:00:00.000Z' }
+ optional_attributes = { expires_at: 3.weeks.from_now }
attributes = attributes_for(:key).merge(optional_attributes)
post api("/users/#{user.id}/keys", admin), params: attributes
expect(response).to have_gitlab_http_status(:created)
- expect(json_response['expires_at']).to eq(optional_attributes[:expires_at])
+ expect(json_response['expires_at'].to_date).to eq(optional_attributes[:expires_at].to_date)
end
it "returns 400 for invalid ID" do
@@ -2373,13 +2373,13 @@ RSpec.describe API::Users do
end
it 'creates SSH key with `expires_at` attribute' do
- optional_attributes = { expires_at: '2016-01-21T00:00:00.000Z' }
+ optional_attributes = { expires_at: 3.weeks.from_now }
attributes = attributes_for(:key).merge(optional_attributes)
post api("/user/keys", user), params: attributes
expect(response).to have_gitlab_http_status(:created)
- expect(json_response['expires_at']).to eq(optional_attributes[:expires_at])
+ expect(json_response['expires_at'].to_date).to eq(optional_attributes[:expires_at].to_date)
end
it "returns a 401 error if unauthorized" do