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
c4227778
Commit
c4227778
authored
Jun 16, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove references to service from field entity spec
parent
7405a8e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
spec/serializers/service_field_entity_spec.rb
spec/serializers/service_field_entity_spec.rb
+9
-6
No files found.
spec/serializers/service_field_entity_spec.rb
View file @
c4227778
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
ServiceFieldEntity
do
let
(
:request
)
{
double
(
'request'
)
}
subject
{
described_class
.
new
(
field
,
request:
request
,
service:
service
).
as_json
}
subject
{
described_class
.
new
(
field
,
request:
request
,
service:
integration
).
as_json
}
before
do
allow
(
request
).
to
receive
(
:service
).
and_return
(
integration
)
...
...
@@ -16,7 +16,7 @@ RSpec.describe ServiceFieldEntity do
let
(
:integration
)
{
create
(
:jira_integration
)
}
context
'field with type text'
do
let
(
:field
)
{
integration
.
global_fields
.
find
{
|
field
|
field
[
:name
]
==
'username'
}
}
let
(
:field
)
{
integration
_field
(
'username'
)
}
it
'exposes correct attributes'
do
expected_hash
=
{
...
...
@@ -35,7 +35,7 @@ RSpec.describe ServiceFieldEntity do
end
context
'field with type password'
do
let
(
:field
)
{
integration
.
global_fields
.
find
{
|
field
|
field
[
:name
]
==
'password'
}
}
let
(
:field
)
{
integration
_field
(
'password'
)
}
it
'exposes correct attributes but hides password'
do
expected_hash
=
{
...
...
@@ -56,10 +56,9 @@ RSpec.describe ServiceFieldEntity do
context
'EmailsOnPush Service'
do
let
(
:integration
)
{
create
(
:emails_on_push_integration
,
send_from_committer_email:
'1'
)
}
let
(
:service
)
{
integration
}
# TODO: remove when https://gitlab.com/gitlab-org/gitlab/-/issues/330300 is complete
context
'field with type checkbox'
do
let
(
:field
)
{
integration
.
global_fields
.
find
{
|
field
|
field
[
:name
]
==
'send_from_committer_email'
}
}
let
(
:field
)
{
integration
_field
(
'send_from_committer_email'
)
}
it
'exposes correct attributes and casts value to Boolean'
do
expected_hash
=
{
...
...
@@ -78,7 +77,7 @@ RSpec.describe ServiceFieldEntity do
end
context
'field with type select'
do
let
(
:field
)
{
integration
.
global_fields
.
find
{
|
field
|
field
[
:name
]
==
'branches_to_be_notified'
}
}
let
(
:field
)
{
integration
_field
(
'branches_to_be_notified'
)
}
it
'exposes correct attributes'
do
expected_hash
=
{
...
...
@@ -97,4 +96,8 @@ RSpec.describe ServiceFieldEntity do
end
end
end
def
integration_field
(
name
)
integration
.
global_fields
.
find
{
|
f
|
f
[
:name
]
==
name
}
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