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
586a14ff
Commit
586a14ff
authored
Jun 29, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove references to service in github/status_message_spec.rb
parent
f9782c3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
ee/spec/models/integrations/github/status_message_spec.rb
ee/spec/models/integrations/github/status_message_spec.rb
+11
-11
No files found.
ee/spec/models/integrations/github/status_message_spec.rb
View file @
586a14ff
...
...
@@ -6,7 +6,7 @@ RSpec.describe Integrations::Github::StatusMessage do
include
Rails
.
application
.
routes
.
url_helpers
let
(
:project
)
{
double
(
:project
,
namespace:
"me"
,
to_s:
'example_project'
)
}
let
(
:
service
)
{
double
(
:service
,
static_context?:
false
)
}
let
(
:
integration
)
{
double
(
:integration
,
static_context?:
false
)
}
before
do
stub_config_setting
(
host:
'instance-host'
)
...
...
@@ -14,14 +14,14 @@ RSpec.describe Integrations::Github::StatusMessage do
describe
'#description'
do
it
'includes human readable gitlab status'
do
subject
=
described_class
.
new
(
project
,
service
,
detailed_status:
'passed'
)
subject
=
described_class
.
new
(
project
,
integration
,
detailed_status:
'passed'
)
expect
(
subject
.
description
).
to
eq
"Pipeline passed on GitLab"
end
it
'gets truncated to 140 chars'
do
dummy_text
=
'a'
*
500
subject
=
described_class
.
new
(
project
,
service
,
detailed_status:
dummy_text
)
subject
=
described_class
.
new
(
project
,
integration
,
detailed_status:
dummy_text
)
expect
(
subject
.
description
.
length
).
to
eq
140
end
...
...
@@ -43,7 +43,7 @@ RSpec.describe Integrations::Github::StatusMessage do
with_them
do
it
'transforms status'
do
subject
=
described_class
.
new
(
project
,
service
,
status:
gitlab_status
)
subject
=
described_class
.
new
(
project
,
integration
,
status:
gitlab_status
)
expect
(
subject
.
status
).
to
eq
github_status
end
...
...
@@ -51,7 +51,7 @@ RSpec.describe Integrations::Github::StatusMessage do
end
describe
'#status_options'
do
let
(
:subject
)
{
described_class
.
new
(
project
,
service
,
id:
1
)
}
let
(
:subject
)
{
described_class
.
new
(
project
,
integration
,
id:
1
)
}
it
'includes context'
do
expect
(
subject
.
status_options
[
:context
]).
to
be_a
String
...
...
@@ -68,12 +68,12 @@ RSpec.describe Integrations::Github::StatusMessage do
describe
'#context'
do
subject
do
described_class
.
new
(
project
,
service
,
ref:
'some-ref'
)
described_class
.
new
(
project
,
integration
,
ref:
'some-ref'
)
end
context
'when status context is supposed to be dynamic'
do
before
do
allow
(
service
).
to
receive
(
:static_context?
).
and_return
(
false
)
allow
(
integration
).
to
receive
(
:static_context?
).
and_return
(
false
)
end
it
'appends pipeline reference to the status context'
do
...
...
@@ -83,7 +83,7 @@ RSpec.describe Integrations::Github::StatusMessage do
context
'when status context is supposed to be static'
do
before
do
allow
(
service
).
to
receive
(
:static_context?
).
and_return
(
true
)
allow
(
integration
).
to
receive
(
:static_context?
).
and_return
(
true
)
end
it
'appends instance hostname to the status context'
do
...
...
@@ -98,7 +98,7 @@ RSpec.describe Integrations::Github::StatusMessage do
let
(
:sample_data
)
{
Gitlab
::
DataBuilder
::
Pipeline
.
build
(
pipeline
)
}
subject
do
described_class
.
from_pipeline_data
(
project
,
service
,
sample_data
)
described_class
.
from_pipeline_data
(
project
,
integration
,
sample_data
)
end
it
'builds an instance of Integrations::Github::StatusMessage'
do
...
...
@@ -136,11 +136,11 @@ RSpec.describe Integrations::Github::StatusMessage do
context
'when static context has been configured'
do
before
do
allow
(
service
).
to
receive
(
:static_context?
).
and_return
(
true
)
allow
(
integration
).
to
receive
(
:static_context?
).
and_return
(
true
)
end
subject
do
described_class
.
from_pipeline_data
(
project
,
service
,
sample_data
)
described_class
.
from_pipeline_data
(
project
,
integration
,
sample_data
)
end
it
'appends instance name to the context name'
do
...
...
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