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
2fe9ee6a
Commit
2fe9ee6a
authored
Aug 23, 2021
by
drew cimino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consolidate stub helpers and use them consistently
parent
5d7fa282
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
10 deletions
+6
-10
spec/lib/gitlab/chat/command_spec.rb
spec/lib/gitlab/chat/command_spec.rb
+1
-1
spec/services/ci/create_pipeline_service_spec.rb
spec/services/ci/create_pipeline_service_spec.rb
+1
-1
spec/spec_helper.rb
spec/spec_helper.rb
+0
-1
spec/support/helpers/stub_gitlab_calls.rb
spec/support/helpers/stub_gitlab_calls.rb
+4
-0
spec/support/helpers/stub_gitlab_data.rb
spec/support/helpers/stub_gitlab_data.rb
+0
-7
No files found.
spec/lib/gitlab/chat/command_spec.rb
View file @
2fe9ee6a
...
...
@@ -44,7 +44,7 @@ RSpec.describe Gitlab::Chat::Command do
let
(
:pipeline
)
{
command
.
create_pipeline
}
before
do
stub_ci_pipeline_
yaml_file
(
gitlab_ci_yaml
)
stub_ci_pipeline_
to_return_yaml_file
project
.
add_developer
(
chat_name
.
user
)
end
...
...
spec/services/ci/create_pipeline_service_spec.rb
View file @
2fe9ee6a
...
...
@@ -11,7 +11,7 @@ RSpec.describe Ci::CreatePipelineService do
let
(
:ref_name
)
{
'refs/heads/master'
}
before
do
stub_ci_pipeline_
yaml_file
(
gitlab_ci_yaml
)
stub_ci_pipeline_
to_return_yaml_file
end
describe
'#execute'
do
...
...
spec/spec_helper.rb
View file @
2fe9ee6a
...
...
@@ -160,7 +160,6 @@ RSpec.configure do |config|
config
.
include
GitlabRoutingHelper
config
.
include
StubExperiments
config
.
include
StubGitlabCalls
config
.
include
StubGitlabData
config
.
include
NextFoundInstanceOf
config
.
include
NextInstanceOf
config
.
include
TestEnv
...
...
spec/support/helpers/stub_gitlab_calls.rb
View file @
2fe9ee6a
...
...
@@ -18,6 +18,10 @@ module StubGitlabCalls
stub_ci_pipeline_yaml_file
(
gitlab_ci_yaml
)
end
def
gitlab_ci_yaml
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
))
end
def
stub_ci_pipeline_yaml_file
(
ci_yaml_content
)
allow_any_instance_of
(
Repository
)
.
to
receive
(
:gitlab_ci_yml_for
)
...
...
spec/support/helpers/stub_gitlab_data.rb
deleted
100644 → 0
View file @
5d7fa282
# frozen_string_literal: true
module
StubGitlabData
def
gitlab_ci_yaml
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
))
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