diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-28 21:09:04 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-28 21:09:04 +0000 |
commit | c6c346e8c7f0865f0016a458511e9fabfc8b9c1a (patch) | |
tree | 5b3a734e945e18c88817935c359c191140a11010 /spec/controllers | |
parent | e1b9b92a49eea88ea7c3b101aec0315e64e94678 (diff) | |
download | gitlab-ce-c6c346e8c7f0865f0016a458511e9fabfc8b9c1a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/groups/group_members_controller_spec.rb | 12 | ||||
-rw-r--r-- | spec/controllers/projects/project_members_controller_spec.rb | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/spec/controllers/groups/group_members_controller_spec.rb b/spec/controllers/groups/group_members_controller_spec.rb index 5425a437c80..435c04c7667 100644 --- a/spec/controllers/groups/group_members_controller_spec.rb +++ b/spec/controllers/groups/group_members_controller_spec.rb @@ -221,6 +221,18 @@ RSpec.describe Groups::GroupMembersController do expect(requester.reload.expires_at).not_to eq(expires_at.to_date) end + + it 'returns error status' do + subject + + expect(response).to have_gitlab_http_status(:unprocessable_entity) + end + + it 'returns error message' do + subject + + expect(json_response).to eq({ 'message' => 'Expires at cannot be a date in the past' }) + end end context 'when set to a date in the future' do diff --git a/spec/controllers/projects/project_members_controller_spec.rb b/spec/controllers/projects/project_members_controller_spec.rb index 971eb782fa4..12240ad4be0 100644 --- a/spec/controllers/projects/project_members_controller_spec.rb +++ b/spec/controllers/projects/project_members_controller_spec.rb @@ -321,6 +321,18 @@ RSpec.describe Projects::ProjectMembersController do expect(requester.reload.expires_at).not_to eq(expires_at.to_date) end + + it 'returns error status' do + subject + + expect(response).to have_gitlab_http_status(:unprocessable_entity) + end + + it 'returns error message' do + subject + + expect(json_response).to eq({ 'message' => 'Expires at cannot be a date in the past' }) + end end context 'when set to a date in the future' do |