Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d9823a42
Commit
d9823a42
authored
Feb 26, 2019
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added error entities
parent
73df7adb
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
0 deletions
+85
-0
ee/lib/ee/gitlab/scim/error.rb
ee/lib/ee/gitlab/scim/error.rb
+13
-0
ee/lib/ee/gitlab/scim/not_found.rb
ee/lib/ee/gitlab/scim/not_found.rb
+25
-0
ee/spec/lib/gitlab/scim/error_spec.rb
ee/spec/lib/gitlab/scim/error_spec.rb
+24
-0
ee/spec/lib/gitlab/scim/not_found_spec.rb
ee/spec/lib/gitlab/scim/not_found_spec.rb
+23
-0
No files found.
ee/lib/ee/gitlab/scim/error.rb
0 → 100644
View file @
d9823a42
# frozen_string_literal: true
module
EE
module
Gitlab
module
Scim
class
Error
<
EE
::
Gitlab
::
Scim
::
NotFound
def
status
409
end
end
end
end
end
ee/lib/ee/gitlab/scim/not_found.rb
0 → 100644
View file @
d9823a42
# frozen_string_literal: true
module
EE
module
Gitlab
module
Scim
class
NotFound
<
Grape
::
Entity
expose
:schemas
expose
:detail
,
safe:
true
expose
:status
private
DEFAULT_SCHEMA
=
'urn:ietf:params:scim:api:messages:2.0:Error'
def
schemas
[
DEFAULT_SCHEMA
]
end
def
status
404
end
end
end
end
end
ee/spec/lib/gitlab/scim/error_spec.rb
0 → 100644
View file @
d9823a42
# frozen_string_literal: true
require
'spec_helper'
describe
::
EE
::
Gitlab
::
Scim
::
Error
do
let
(
:params
)
{
{
detail:
'error'
}
}
let
(
:entity
)
do
described_class
.
new
(
params
)
end
subject
{
entity
.
as_json
}
it
'contains the schemas'
do
expect
(
subject
[
:schemas
]).
not_to
be_empty
end
it
'contains the detail'
do
expect
(
subject
[
:detail
]).
to
eq
(
params
[
:detail
])
end
it
'contains the status'
do
expect
(
subject
[
:status
]).
to
eq
(
409
)
end
end
ee/spec/lib/gitlab/scim/not_found_spec.rb
0 → 100644
View file @
d9823a42
# frozen_string_literal: true
require
'spec_helper'
describe
::
EE
::
Gitlab
::
Scim
::
NotFound
do
let
(
:entity
)
do
described_class
.
new
({})
end
subject
{
entity
.
as_json
}
it
'contains the schemas'
do
expect
(
subject
[
:schemas
]).
not_to
be_empty
end
it
'contains the detail'
do
expect
(
subject
[
:detail
]).
to
be_nil
end
it
'contains the status'
do
expect
(
subject
[
:status
]).
to
eq
(
404
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment