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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
0282449e
Commit
0282449e
authored
Nov 20, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
0ecdcf59
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
147 additions
and
55 deletions
+147
-55
changelogs/unreleased/13231-apollo-discussion-caching.yml
changelogs/unreleased/13231-apollo-discussion-caching.yml
+5
-0
doc/administration/geo/replication/index.md
doc/administration/geo/replication/index.md
+7
-1
spec/lib/backup/repository_spec.rb
spec/lib/backup/repository_spec.rb
+6
-2
spec/lib/banzai/filter/commit_reference_filter_spec.rb
spec/lib/banzai/filter/commit_reference_filter_spec.rb
+3
-1
spec/lib/banzai/filter/markdown_filter_spec.rb
spec/lib/banzai/filter/markdown_filter_spec.rb
+6
-2
spec/lib/banzai/filter/milestone_reference_filter_spec.rb
spec/lib/banzai/filter/milestone_reference_filter_spec.rb
+9
-3
spec/lib/banzai/filter/reference_redactor_filter_spec.rb
spec/lib/banzai/filter/reference_redactor_filter_spec.rb
+6
-2
spec/lib/banzai/filter/syntax_highlight_filter_spec.rb
spec/lib/banzai/filter/syntax_highlight_filter_spec.rb
+6
-2
spec/lib/banzai/object_renderer_spec.rb
spec/lib/banzai/object_renderer_spec.rb
+6
-2
spec/lib/banzai/reference_parser/commit_parser_spec.rb
spec/lib/banzai/reference_parser/commit_parser_spec.rb
+15
-10
spec/lib/banzai/reference_redactor_spec.rb
spec/lib/banzai/reference_redactor_spec.rb
+5
-4
spec/lib/bitbucket/connection_spec.rb
spec/lib/bitbucket/connection_spec.rb
+12
-4
spec/lib/extracts_path_spec.rb
spec/lib/extracts_path_spec.rb
+3
-1
spec/lib/gitlab/gitlab_import/client_spec.rb
spec/lib/gitlab/gitlab_import/client_spec.rb
+2
-0
spec/lib/gitlab/gitlab_import/importer_spec.rb
spec/lib/gitlab/gitlab_import/importer_spec.rb
+2
-0
spec/lib/gitlab/gitlab_import/project_creator_spec.rb
spec/lib/gitlab/gitlab_import/project_creator_spec.rb
+2
-0
spec/lib/google_api/auth_spec.rb
spec/lib/google_api/auth_spec.rb
+3
-2
spec/lib/omni_auth/strategies/saml_spec.rb
spec/lib/omni_auth/strategies/saml_spec.rb
+3
-1
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+3
-1
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+6
-2
spec/models/clusters/applications/runner_spec.rb
spec/models/clusters/applications/runner_spec.rb
+3
-1
spec/models/cycle_analytics/group_level_spec.rb
spec/models/cycle_analytics/group_level_spec.rb
+3
-1
spec/models/cycle_analytics/project_level_spec.rb
spec/models/cycle_analytics/project_level_spec.rb
+3
-1
spec/models/deployment_spec.rb
spec/models/deployment_spec.rb
+3
-2
spec/models/diff_note_spec.rb
spec/models/diff_note_spec.rb
+3
-1
spec/models/diff_viewer/base_spec.rb
spec/models/diff_viewer/base_spec.rb
+3
-1
spec/models/environment_spec.rb
spec/models/environment_spec.rb
+6
-2
spec/models/event_spec.rb
spec/models/event_spec.rb
+3
-1
spec/models/gpg_signature_spec.rb
spec/models/gpg_signature_spec.rb
+3
-1
spec/models/resource_label_event_spec.rb
spec/models/resource_label_event_spec.rb
+4
-3
spec/uploaders/object_storage_spec.rb
spec/uploaders/object_storage_spec.rb
+3
-1
No files found.
changelogs/unreleased/13231-apollo-discussion-caching.yml
0 → 100644
View file @
0282449e
---
title
:
Removes caching for design tab discusisons
merge_request
:
20374
author
:
type
:
changed
doc/administration/geo/replication/index.md
View file @
0282449e
...
...
@@ -266,7 +266,7 @@ these epics/issues:
| All database content | **Yes** | **Yes** | |
| Project repository | **Yes** | **Yes** | |
| Project wiki repository | **Yes** | **Yes** | |
| Project designs repository |
[No][design-replication] | [No][design-verification] |
|
| Project designs repository |
**Yes** | [No][design-verification] | Behind feature flag (2)
|
| Uploads | **Yes** | [No][upload-verification] | Verified only on transfer, or manually (1) |
| LFS Objects | **Yes** | [No][lfs-verification] | Verified only on transfer, or manually (1) |
| CI job artifacts (other than traces) | **Yes** | [No][artifact-verification] | Verified only manually (1) |
...
...
@@ -307,6 +307,12 @@ these epics/issues:
1. The integrity can be verified manually using
[Integrity Check Rake Task](../../raketasks/check.md)
on both nodes and comparing the output between them.
1. Enable the `
enable_geo_design_sync
` feature flag by running the
following in a Rails console:
```ruby
Feature.disable(:enable_geo_design_sync)
```
DANGER: **DANGER**
Features not on this list, or with **No** in the **Replicated** column,
...
...
spec/lib/backup/repository_spec.rb
View file @
0282449e
...
...
@@ -12,7 +12,9 @@ describe Backup::Repository do
allow
(
progress
).
to
receive
(
:print
)
allow
(
FileUtils
).
to
receive
(
:mv
).
and_return
(
true
)
allow_any_instance_of
(
described_class
).
to
receive
(
:progress
).
and_return
(
progress
)
allow_next_instance_of
(
described_class
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:progress
).
and_return
(
progress
)
end
end
describe
'#dump'
do
...
...
@@ -47,7 +49,9 @@ describe Backup::Repository do
describe
'command failure'
do
before
do
allow_any_instance_of
(
Gitlab
::
Shell
).
to
receive
(
:create_repository
).
and_return
(
false
)
allow_next_instance_of
(
Gitlab
::
Shell
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:create_repository
).
and_return
(
false
)
end
end
context
'hashed storage'
do
...
...
spec/lib/banzai/filter/commit_reference_filter_spec.rb
View file @
0282449e
...
...
@@ -60,7 +60,9 @@ describe Banzai::Filter::CommitReferenceFilter do
end
it
'escapes the title attribute'
do
allow_any_instance_of
(
Commit
).
to
receive
(
:title
).
and_return
(
%{"></a>whatever<a title="}
)
allow_next_instance_of
(
Commit
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:title
).
and_return
(
%{"></a>whatever<a title="}
)
end
doc
=
reference_filter
(
"See
#{
reference
}
"
)
expect
(
doc
.
text
).
to
eq
"See
#{
commit
.
short_id
}
"
...
...
spec/lib/banzai/filter/markdown_filter_spec.rb
View file @
0282449e
...
...
@@ -7,13 +7,17 @@ describe Banzai::Filter::MarkdownFilter do
describe
'markdown engine from context'
do
it
'defaults to CommonMark'
do
expect_any_instance_of
(
Banzai
::
Filter
::
MarkdownEngines
::
CommonMark
).
to
receive
(
:render
).
and_return
(
'test'
)
expect_next_instance_of
(
Banzai
::
Filter
::
MarkdownEngines
::
CommonMark
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:render
).
and_return
(
'test'
)
end
filter
(
'test'
)
end
it
'uses CommonMark'
do
expect_any_instance_of
(
Banzai
::
Filter
::
MarkdownEngines
::
CommonMark
).
to
receive
(
:render
).
and_return
(
'test'
)
expect_next_instance_of
(
Banzai
::
Filter
::
MarkdownEngines
::
CommonMark
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:render
).
and_return
(
'test'
)
end
filter
(
'test'
,
{
markdown_engine: :common_mark
})
end
...
...
spec/lib/banzai/filter/milestone_reference_filter_spec.rb
View file @
0282449e
...
...
@@ -214,7 +214,9 @@ describe Banzai::Filter::MilestoneReferenceFilter do
end
it
'escapes the name attribute'
do
allow_any_instance_of
(
Milestone
).
to
receive
(
:title
).
and_return
(
%{"></a>whatever<a title="}
)
allow_next_instance_of
(
Milestone
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:title
).
and_return
(
%{"></a>whatever<a title="}
)
end
doc
=
reference_filter
(
"See
#{
reference
}
"
)
...
...
@@ -251,7 +253,9 @@ describe Banzai::Filter::MilestoneReferenceFilter do
end
it
'escapes the name attribute'
do
allow_any_instance_of
(
Milestone
).
to
receive
(
:title
).
and_return
(
%{"></a>whatever<a title="}
)
allow_next_instance_of
(
Milestone
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:title
).
and_return
(
%{"></a>whatever<a title="}
)
end
doc
=
reference_filter
(
"See
#{
reference
}
"
)
...
...
@@ -288,7 +292,9 @@ describe Banzai::Filter::MilestoneReferenceFilter do
end
it
'escapes the name attribute'
do
allow_any_instance_of
(
Milestone
).
to
receive
(
:title
).
and_return
(
%{"></a>whatever<a title="}
)
allow_next_instance_of
(
Milestone
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:title
).
and_return
(
%{"></a>whatever<a title="}
)
end
doc
=
reference_filter
(
"See
#{
reference
}
"
)
...
...
spec/lib/banzai/filter/reference_redactor_filter_spec.rb
View file @
0282449e
...
...
@@ -42,7 +42,9 @@ describe Banzai::Filter::ReferenceRedactorFilter do
context
'valid projects'
do
before
do
allow_any_instance_of
(
Banzai
::
ReferenceParser
::
BaseParser
).
to
receive
(
:can_read_reference?
).
and_return
(
true
)
allow_next_instance_of
(
Banzai
::
ReferenceParser
::
BaseParser
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:can_read_reference?
).
and_return
(
true
)
end
end
it
'allows permitted Project references'
do
...
...
@@ -59,7 +61,9 @@ describe Banzai::Filter::ReferenceRedactorFilter do
context
'invalid projects'
do
before
do
allow_any_instance_of
(
Banzai
::
ReferenceParser
::
BaseParser
).
to
receive
(
:can_read_reference?
).
and_return
(
false
)
allow_next_instance_of
(
Banzai
::
ReferenceParser
::
BaseParser
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:can_read_reference?
).
and_return
(
false
)
end
end
it
'removes unpermitted references'
do
...
...
spec/lib/banzai/filter/syntax_highlight_filter_spec.rb
View file @
0282449e
...
...
@@ -92,7 +92,9 @@ describe Banzai::Filter::SyntaxHighlightFilter do
context
"when Rouge lexing fails"
do
before
do
allow_any_instance_of
(
Rouge
::
Lexers
::
Ruby
).
to
receive
(
:stream_tokens
).
and_raise
(
StandardError
)
allow_next_instance_of
(
Rouge
::
Lexers
::
Ruby
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:stream_tokens
).
and_raise
(
StandardError
)
end
end
it
"highlights as plaintext"
do
...
...
@@ -106,7 +108,9 @@ describe Banzai::Filter::SyntaxHighlightFilter do
context
"when Rouge lexing fails after a retry"
do
before
do
allow_any_instance_of
(
Rouge
::
Lexers
::
PlainText
).
to
receive
(
:stream_tokens
).
and_raise
(
StandardError
)
allow_next_instance_of
(
Rouge
::
Lexers
::
PlainText
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:stream_tokens
).
and_raise
(
StandardError
)
end
end
it
"does not add highlighting classes"
do
...
...
spec/lib/banzai/object_renderer_spec.rb
View file @
0282449e
...
...
@@ -25,7 +25,9 @@ describe Banzai::ObjectRenderer do
end
it
'calls Banzai::ReferenceRedactor to perform redaction'
do
expect_any_instance_of
(
Banzai
::
ReferenceRedactor
).
to
receive
(
:redact
).
and_call_original
expect_next_instance_of
(
Banzai
::
ReferenceRedactor
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:redact
).
and_call_original
end
renderer
.
render
([
object
],
:note
)
end
...
...
@@ -85,7 +87,9 @@ describe Banzai::ObjectRenderer do
end
it
'calls Banzai::ReferenceRedactor to perform redaction'
do
expect_any_instance_of
(
Banzai
::
ReferenceRedactor
).
to
receive
(
:redact
).
and_call_original
expect_next_instance_of
(
Banzai
::
ReferenceRedactor
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:redact
).
and_call_original
end
renderer
.
render
([
cacheless_thing
],
:title
)
end
...
...
spec/lib/banzai/reference_parser/commit_parser_spec.rb
View file @
0282449e
...
...
@@ -35,8 +35,9 @@ describe Banzai::ReferenceParser::CommitParser do
it
'returns an Array of commits'
do
commit
=
double
(
:commit
)
allow_any_instance_of
(
Project
).
to
receive
(
:valid_repo?
)
.
and_return
(
true
)
allow_next_instance_of
(
Project
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:valid_repo?
).
and_return
(
true
)
end
expect
(
subject
).
to
receive
(
:find_commits
)
.
with
(
project
,
[
'123'
])
...
...
@@ -46,8 +47,9 @@ describe Banzai::ReferenceParser::CommitParser do
end
it
'returns an empty Array when the commit could not be found'
do
allow_any_instance_of
(
Project
).
to
receive
(
:valid_repo?
)
.
and_return
(
true
)
allow_next_instance_of
(
Project
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:valid_repo?
).
and_return
(
true
)
end
expect
(
subject
).
to
receive
(
:find_commits
)
.
with
(
project
,
[
'123'
])
...
...
@@ -57,8 +59,9 @@ describe Banzai::ReferenceParser::CommitParser do
end
it
'skips projects without valid repositories'
do
allow_any_instance_of
(
Project
).
to
receive
(
:valid_repo?
)
.
and_return
(
false
)
allow_next_instance_of
(
Project
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:valid_repo?
).
and_return
(
false
)
end
expect
(
subject
.
referenced_by
([
link
])).
to
eq
([])
end
...
...
@@ -66,8 +69,9 @@ describe Banzai::ReferenceParser::CommitParser do
context
'when the link does not have a data-commit attribute'
do
it
'returns an empty Array'
do
allow_any_instance_of
(
Project
).
to
receive
(
:valid_repo?
)
.
and_return
(
true
)
allow_next_instance_of
(
Project
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:valid_repo?
).
and_return
(
true
)
end
expect
(
subject
.
referenced_by
([
link
])).
to
eq
([])
end
...
...
@@ -76,8 +80,9 @@ describe Banzai::ReferenceParser::CommitParser do
context
'when the link does not have a data-project attribute'
do
it
'returns an empty Array'
do
allow_any_instance_of
(
Project
).
to
receive
(
:valid_repo?
)
.
and_return
(
true
)
allow_next_instance_of
(
Project
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:valid_repo?
).
and_return
(
true
)
end
expect
(
subject
.
referenced_by
([
link
])).
to
eq
([])
end
...
...
spec/lib/banzai/reference_redactor_spec.rb
View file @
0282449e
...
...
@@ -173,10 +173,11 @@ describe Banzai::ReferenceRedactor do
doc
=
Nokogiri
::
HTML
.
fragment
(
'<a data-reference-type="issue"></a>'
)
node
=
doc
.
children
[
0
]
expect_any_instance_of
(
Banzai
::
ReferenceParser
::
IssueParser
)
.
to
receive
(
:nodes_visible_to_user
)
.
with
(
user
,
[
node
])
.
and_return
([
node
])
expect_next_instance_of
(
Banzai
::
ReferenceParser
::
IssueParser
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:nodes_visible_to_user
)
.
with
(
user
,
[
node
])
.
and_return
([
node
])
end
expect
(
redactor
.
nodes_visible_to_user
([
node
])).
to
eq
(
Set
.
new
([
node
]))
end
...
...
spec/lib/bitbucket/connection_spec.rb
View file @
0282449e
...
...
@@ -4,12 +4,16 @@ require 'spec_helper'
describe
Bitbucket
::
Connection
do
before
do
allow_any_instance_of
(
described_class
).
to
receive
(
:provider
).
and_return
(
double
(
app_id:
''
,
app_secret:
''
))
allow_next_instance_of
(
described_class
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:provider
).
and_return
(
double
(
app_id:
''
,
app_secret:
''
))
end
end
describe
'#get'
do
it
'calls OAuth2::AccessToken::get'
do
expect_any_instance_of
(
OAuth2
::
AccessToken
).
to
receive
(
:get
).
and_return
(
double
(
parsed:
true
))
expect_next_instance_of
(
OAuth2
::
AccessToken
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:get
).
and_return
(
double
(
parsed:
true
))
end
connection
=
described_class
.
new
({})
...
...
@@ -19,7 +23,9 @@ describe Bitbucket::Connection do
describe
'#expired?'
do
it
'calls connection.expired?'
do
expect_any_instance_of
(
OAuth2
::
AccessToken
).
to
receive
(
:expired?
).
and_return
(
true
)
expect_next_instance_of
(
OAuth2
::
AccessToken
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:expired?
).
and_return
(
true
)
end
expect
(
described_class
.
new
({}).
expired?
).
to
be_truthy
end
...
...
@@ -29,7 +35,9 @@ describe Bitbucket::Connection do
it
'calls connection.refresh!'
do
response
=
double
(
token:
nil
,
expires_at:
nil
,
expires_in:
nil
,
refresh_token:
nil
)
expect_any_instance_of
(
OAuth2
::
AccessToken
).
to
receive
(
:refresh!
).
and_return
(
response
)
expect_next_instance_of
(
OAuth2
::
AccessToken
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:refresh!
).
and_return
(
response
)
end
described_class
.
new
({}).
refresh!
end
...
...
spec/lib/extracts_path_spec.rb
View file @
0282449e
...
...
@@ -88,7 +88,9 @@ describe ExtractsPath do
context
'subclass overrides get_id'
do
it
'uses ref returned by get_id'
do
allow_any_instance_of
(
self
.
class
).
to
receive
(
:get_id
)
{
'38008cb17ce1466d8fec2dfa6f6ab8dcfe5cf49e'
}
allow_next_instance_of
(
self
.
class
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:get_id
)
{
'38008cb17ce1466d8fec2dfa6f6ab8dcfe5cf49e'
}
end
assign_ref_vars
...
...
spec/lib/gitlab/gitlab_import/client_spec.rb
View file @
0282449e
# frozen_string_literal: true
require
'spec_helper'
describe
Gitlab
::
GitlabImport
::
Client
do
...
...
spec/lib/gitlab/gitlab_import/importer_spec.rb
View file @
0282449e
# frozen_string_literal: true
require
'spec_helper'
describe
Gitlab
::
GitlabImport
::
Importer
do
...
...
spec/lib/gitlab/gitlab_import/project_creator_spec.rb
View file @
0282449e
# frozen_string_literal: true
require
'spec_helper'
describe
Gitlab
::
GitlabImport
::
ProjectCreator
do
...
...
spec/lib/google_api/auth_spec.rb
View file @
0282449e
...
...
@@ -30,8 +30,9 @@ describe GoogleApi::Auth do
end
before
do
allow_any_instance_of
(
OAuth2
::
Strategy
::
AuthCode
)
.
to
receive
(
:get_token
).
and_return
(
token
)
allow_next_instance_of
(
OAuth2
::
Strategy
::
AuthCode
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:get_token
).
and_return
(
token
)
end
end
it
'returns token and expires_at'
do
...
...
spec/lib/omni_auth/strategies/saml_spec.rb
View file @
0282449e
...
...
@@ -15,7 +15,9 @@ describe OmniAuth::Strategies::SAML, type: :strategy do
it
'stores request ID during request phase'
do
request_id
=
double
allow_any_instance_of
(
OneLogin
::
RubySaml
::
Authrequest
).
to
receive
(
:uuid
).
and_return
(
request_id
)
allow_next_instance_of
(
OneLogin
::
RubySaml
::
Authrequest
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:uuid
).
and_return
(
request_id
)
end
post
'/users/auth/saml'
expect
(
session
[
'last_authn_request_id'
]).
to
eq
(
request_id
)
...
...
spec/mailers/notify_spec.rb
View file @
0282449e
...
...
@@ -1095,7 +1095,9 @@ describe Notify do
context
'when note is not on text'
do
before
do
allow_any_instance_of
(
DiffDiscussion
).
to
receive
(
:on_text?
).
and_return
(
false
)
allow_next_instance_of
(
DiffDiscussion
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:on_text?
).
and_return
(
false
)
end
end
it
'does not include diffs with character-level highlighting'
do
...
...
spec/models/ci/pipeline_spec.rb
View file @
0282449e
...
...
@@ -2474,7 +2474,9 @@ describe Ci::Pipeline, :mailer do
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
status:
'created'
,
project:
project
,
ref:
'master'
,
sha:
'a288a022a53a5a944fae87bcec6efc87b7061808'
)
}
it
"returns merge requests whose `diff_head_sha` matches the pipeline's SHA"
do
allow_any_instance_of
(
MergeRequest
).
to
receive
(
:diff_head_sha
)
{
'a288a022a53a5a944fae87bcec6efc87b7061808'
}
allow_next_instance_of
(
MergeRequest
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:diff_head_sha
)
{
'a288a022a53a5a944fae87bcec6efc87b7061808'
}
end
merge_request
=
create
(
:merge_request
,
source_project:
project
,
head_pipeline:
pipeline
,
source_branch:
pipeline
.
ref
)
expect
(
pipeline
.
merge_requests_as_head_pipeline
).
to
eq
([
merge_request
])
...
...
@@ -2488,7 +2490,9 @@ describe Ci::Pipeline, :mailer do
it
"doesn't return merge requests whose `diff_head_sha` doesn't match the pipeline's SHA"
do
create
(
:merge_request
,
source_project:
project
,
source_branch:
pipeline
.
ref
)
allow_any_instance_of
(
MergeRequest
).
to
receive
(
:diff_head_sha
)
{
'97de212e80737a608d939f648d959671fb0a0142b'
}
allow_next_instance_of
(
MergeRequest
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:diff_head_sha
)
{
'97de212e80737a608d939f648d959671fb0a0142b'
}
end
expect
(
pipeline
.
merge_requests_as_head_pipeline
).
to
be_empty
end
...
...
spec/models/clusters/applications/runner_spec.rb
View file @
0282449e
...
...
@@ -174,7 +174,9 @@ describe Clusters::Applications::Runner do
subject
{
create
(
:clusters_applications_runner
,
:scheduled
,
runner:
ci_runner
)
}
it
'calls prepare_uninstall'
do
expect_any_instance_of
(
described_class
).
to
receive
(
:prepare_uninstall
).
and_call_original
expect_next_instance_of
(
described_class
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:prepare_uninstall
).
and_call_original
end
subject
.
make_uninstalling!
end
...
...
spec/models/cycle_analytics/group_level_spec.rb
View file @
0282449e
...
...
@@ -22,7 +22,9 @@ describe CycleAnalytics::GroupLevel do
describe
'#stats'
do
before
do
allow_any_instance_of
(
Gitlab
::
ReferenceExtractor
).
to
receive
(
:issues
).
and_return
([
issue
])
allow_next_instance_of
(
Gitlab
::
ReferenceExtractor
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:issues
).
and_return
([
issue
])
end
create_cycle
(
user
,
project
,
issue
,
mr
,
milestone
,
pipeline
)
deploy_master
(
user
,
project
)
...
...
spec/models/cycle_analytics/project_level_spec.rb
View file @
0282449e
...
...
@@ -15,7 +15,9 @@ describe CycleAnalytics::ProjectLevel do
describe
'#all_medians_by_stage'
do
before
do
allow_any_instance_of
(
Gitlab
::
ReferenceExtractor
).
to
receive
(
:issues
).
and_return
([
issue
])
allow_next_instance_of
(
Gitlab
::
ReferenceExtractor
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:issues
).
and_return
([
issue
])
end
create_cycle
(
user
,
project
,
issue
,
mr
,
milestone
,
pipeline
)
deploy_master
(
user
,
project
)
...
...
spec/models/deployment_spec.rb
View file @
0282449e
...
...
@@ -32,8 +32,9 @@ describe Deployment do
let
(
:deployment
)
{
create
(
:deployment
,
deployable:
build
)
}
it
'delegates to other_scheduled_actions'
do
expect_any_instance_of
(
Ci
::
Build
)
.
to
receive
(
:other_scheduled_actions
)
expect_next_instance_of
(
Ci
::
Build
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:other_scheduled_actions
)
end
subject
end
...
...
spec/models/diff_note_spec.rb
View file @
0282449e
...
...
@@ -343,7 +343,9 @@ describe DiffNote do
context
'when line is not suggestible'
do
it
'returns false'
do
allow_any_instance_of
(
Gitlab
::
Diff
::
Line
).
to
receive
(
:suggestible?
)
{
false
}
allow_next_instance_of
(
Gitlab
::
Diff
::
Line
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:suggestible?
)
{
false
}
end
expect
(
subject
.
supports_suggestion?
).
to
be
(
false
)
end
...
...
spec/models/diff_viewer/base_spec.rb
View file @
0282449e
...
...
@@ -60,7 +60,9 @@ describe DiffViewer::Base do
context
'when the binaryness does not match'
do
before
do
allow_any_instance_of
(
Blob
).
to
receive
(
:binary_in_repo?
).
and_return
(
true
)
allow_next_instance_of
(
Blob
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:binary_in_repo?
).
and_return
(
true
)
end
end
it
'returns false'
do
...
...
spec/models/environment_spec.rb
View file @
0282449e
...
...
@@ -484,7 +484,9 @@ describe Environment, :use_clean_rails_memory_store_caching do
subject
{
environment
.
last_deployment
}
before
do
allow_any_instance_of
(
Deployment
).
to
receive
(
:create_ref
)
allow_next_instance_of
(
Deployment
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:create_ref
)
end
end
context
'when there is an old deployment record'
do
...
...
@@ -1031,7 +1033,9 @@ describe Environment, :use_clean_rails_memory_store_caching do
describe
'#prometheus_adapter'
do
it
'calls prometheus adapter service'
do
expect_any_instance_of
(
Prometheus
::
AdapterService
).
to
receive
(
:prometheus_adapter
)
expect_next_instance_of
(
Prometheus
::
AdapterService
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:prometheus_adapter
)
end
subject
.
prometheus_adapter
end
...
...
spec/models/event_spec.rb
View file @
0282449e
...
...
@@ -20,7 +20,9 @@ describe Event do
describe
'after_create :reset_project_activity'
do
it
'calls the reset_project_activity method'
do
expect_any_instance_of
(
described_class
).
to
receive
(
:reset_project_activity
)
expect_next_instance_of
(
described_class
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:reset_project_activity
)
end
create_push_event
(
project
,
project
.
owner
)
end
...
...
spec/models/gpg_signature_spec.rb
View file @
0282449e
...
...
@@ -75,7 +75,9 @@ RSpec.describe GpgSignature do
describe
'#commit'
do
it
'fetches the commit through the project'
do
expect_any_instance_of
(
Project
).
to
receive
(
:commit
).
with
(
commit_sha
).
and_return
(
commit
)
expect_next_instance_of
(
Project
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:commit
).
with
(
commit_sha
).
and_return
(
commit
)
end
gpg_signature
.
commit
end
...
...
spec/models/resource_label_event_spec.rb
View file @
0282449e
...
...
@@ -49,9 +49,10 @@ RSpec.describe ResourceLabelEvent, type: :model do
describe
'#expire_etag_cache'
do
def
expect_expiration
(
issue
)
expect_any_instance_of
(
Gitlab
::
EtagCaching
::
Store
)
.
to
receive
(
:touch
)
.
with
(
"/
#{
issue
.
project
.
namespace
.
to_param
}
/
#{
issue
.
project
.
to_param
}
/noteable/issue/
#{
issue
.
id
}
/notes"
)
expect_next_instance_of
(
Gitlab
::
EtagCaching
::
Store
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:touch
)
.
with
(
"/
#{
issue
.
project
.
namespace
.
to_param
}
/
#{
issue
.
project
.
to_param
}
/noteable/issue/
#{
issue
.
id
}
/notes"
)
end
end
it
'expires resource note etag cache on event save'
do
...
...
spec/uploaders/object_storage_spec.rb
View file @
0282449e
...
...
@@ -151,7 +151,9 @@ describe ObjectStorage do
describe
'fails'
do
it
'is handled gracefully'
do
store
=
uploader
.
object_store
expect_any_instance_of
(
Upload
).
to
receive
(
:save!
).
and_raise
(
"An error"
)
expect_next_instance_of
(
Upload
)
do
|
instance
|
expect
(
instance
).
to
receive
(
:save!
).
and_raise
(
"An error"
)
end
expect
{
subject
}.
to
raise_error
(
"An error"
)
expect
(
uploader
.
exists?
).
to
be_truthy
...
...
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