Commit cac0d9b8 authored by Doug Stull's avatar Doug Stull

Resolve RSpec/EmptyLineAfterLetBlock Exceptions in Main area

- comply to style guide.
parent 1d704420
This diff is collapsed.
...@@ -18,6 +18,7 @@ RSpec.describe ObjectStoreSettings do ...@@ -18,6 +18,7 @@ RSpec.describe ObjectStoreSettings do
'region' => 'us-east-1' 'region' => 'us-east-1'
} }
end end
let(:config) do let(:config) do
{ {
'lfs' => { 'enabled' => true }, 'lfs' => { 'enabled' => true },
......
...@@ -265,6 +265,7 @@ RSpec.describe Boards::IssuesController do ...@@ -265,6 +265,7 @@ RSpec.describe Boards::IssuesController do
hash[:ids] = [issue2.id] hash[:ids] = [issue2.id]
end end
end end
let(:requesting_user) { user } let(:requesting_user) { user }
let(:expected_status) { 200 } let(:expected_status) { 200 }
let(:expected_issue_count) { 2 } let(:expected_issue_count) { 2 }
...@@ -280,6 +281,7 @@ RSpec.describe Boards::IssuesController do ...@@ -280,6 +281,7 @@ RSpec.describe Boards::IssuesController do
hash[:ids] = [issue2.id] hash[:ids] = [issue2.id]
end end
end end
let(:requesting_user) { user } let(:requesting_user) { user }
let(:expected_status) { 403 } let(:expected_status) { 403 }
let(:expected_issue_count) { 1 } let(:expected_issue_count) { 1 }
...@@ -296,6 +298,7 @@ RSpec.describe Boards::IssuesController do ...@@ -296,6 +298,7 @@ RSpec.describe Boards::IssuesController do
hash[:move_before_id] = nil hash[:move_before_id] = nil
end end
end end
let(:requesting_user) { user } let(:requesting_user) { user }
let(:expected_status) { 200 } let(:expected_status) { 200 }
let(:expected_issue_count) { 4 } let(:expected_issue_count) { 4 }
...@@ -317,6 +320,7 @@ RSpec.describe Boards::IssuesController do ...@@ -317,6 +320,7 @@ RSpec.describe Boards::IssuesController do
hash[:move_before_id] = nil hash[:move_before_id] = nil
end end
end end
let(:requesting_user) { user } let(:requesting_user) { user }
let(:expected_status) { 200 } let(:expected_status) { 200 }
let(:expected_issue_count) { 3 } let(:expected_issue_count) { 3 }
...@@ -332,6 +336,7 @@ RSpec.describe Boards::IssuesController do ...@@ -332,6 +336,7 @@ RSpec.describe Boards::IssuesController do
hash[:move_before_id] = nil hash[:move_before_id] = nil
end end
end end
let(:requesting_user) { user } let(:requesting_user) { user }
let(:expected_status) { 200 } let(:expected_status) { 200 }
let(:expected_issue_count) { 4 } let(:expected_issue_count) { 4 }
...@@ -350,6 +355,7 @@ RSpec.describe Boards::IssuesController do ...@@ -350,6 +355,7 @@ RSpec.describe Boards::IssuesController do
hash[:move_after_id] = issue4.id hash[:move_after_id] = issue4.id
end end
end end
let(:requesting_user) { user } let(:requesting_user) { user }
let(:expected_status) { 200 } let(:expected_status) { 200 }
let(:expected_issue_count) { 5 } let(:expected_issue_count) { 5 }
...@@ -365,6 +371,7 @@ RSpec.describe Boards::IssuesController do ...@@ -365,6 +371,7 @@ RSpec.describe Boards::IssuesController do
hash[:ids] = (0..51).to_a hash[:ids] = (0..51).to_a
end end
end end
let(:requesting_user) { user } let(:requesting_user) { user }
let(:expected_status) { 422 } let(:expected_status) { 422 }
let(:expected_issue_count) { 1 } let(:expected_issue_count) { 1 }
...@@ -380,6 +387,7 @@ RSpec.describe Boards::IssuesController do ...@@ -380,6 +387,7 @@ RSpec.describe Boards::IssuesController do
hash[:ids] = 'foobar' hash[:ids] = 'foobar'
end end
end end
let(:requesting_user) { user } let(:requesting_user) { user }
let(:expected_status) { 400 } let(:expected_status) { 400 }
let(:expected_issue_count) { 1 } let(:expected_issue_count) { 1 }
......
...@@ -86,6 +86,7 @@ RSpec.describe Groups::MilestonesController do ...@@ -86,6 +86,7 @@ RSpec.describe Groups::MilestonesController do
let!(:public_project_with_private_issues_and_mrs) do let!(:public_project_with_private_issues_and_mrs) do
create(:project, :public, :issues_private, :merge_requests_private, group: public_group) create(:project, :public, :issues_private, :merge_requests_private, group: public_group)
end end
let!(:private_milestone) { create(:milestone, project: public_project_with_private_issues_and_mrs, title: 'project milestone') } let!(:private_milestone) { create(:milestone, project: public_project_with_private_issues_and_mrs, title: 'project milestone') }
context 'when anonymous user' do context 'when anonymous user' do
......
...@@ -36,6 +36,7 @@ RSpec.describe Groups::Settings::RepositoryController do ...@@ -36,6 +36,7 @@ RSpec.describe Groups::Settings::RepositoryController do
deploy_token_type: DeployToken.deploy_token_types[:group_type] deploy_token_type: DeployToken.deploy_token_types[:group_type]
} }
end end
let(:request_params) do let(:request_params) do
{ {
group_id: group.to_param, group_id: group.to_param,
......
...@@ -53,6 +53,7 @@ RSpec.describe Import::GitlabController do ...@@ -53,6 +53,7 @@ RSpec.describe Import::GitlabController do
let(:gitlab_user) do let(:gitlab_user) do
{ username: gitlab_username }.with_indifferent_access { username: gitlab_username }.with_indifferent_access
end end
let(:gitlab_repo) do let(:gitlab_repo) do
{ {
path: 'vim', path: 'vim',
......
...@@ -245,6 +245,7 @@ RSpec.describe Projects::ForksController do ...@@ -245,6 +245,7 @@ RSpec.describe Projects::ForksController do
continue: continue_params continue: continue_params
} }
end end
let(:continue_params) do let(:continue_params) do
{ {
to: '/-/ide/project/path', to: '/-/ide/project/path',
......
...@@ -59,6 +59,7 @@ RSpec.describe Projects::LogsController do ...@@ -59,6 +59,7 @@ RSpec.describe Projects::LogsController do
container_name: container container_name: container
} }
end end
let(:service_result_json) { Gitlab::Json.parse(service_result.to_json) } let(:service_result_json) { Gitlab::Json.parse(service_result.to_json) }
let_it_be(:cluster) { create(:cluster, :provided_by_gcp, environment_scope: '*', projects: [project]) } let_it_be(:cluster) { create(:cluster, :provided_by_gcp, environment_scope: '*', projects: [project]) }
......
...@@ -302,6 +302,7 @@ RSpec.describe Projects::NotesController do ...@@ -302,6 +302,7 @@ RSpec.describe Projects::NotesController do
target_id: merge_request.id target_id: merge_request.id
}.merge(extra_request_params) }.merge(extra_request_params)
end end
let(:extra_request_params) { {} } let(:extra_request_params) { {} }
let(:project_visibility) { Gitlab::VisibilityLevel::PUBLIC } let(:project_visibility) { Gitlab::VisibilityLevel::PUBLIC }
......
...@@ -27,6 +27,7 @@ RSpec.describe Projects::ProtectedBranchesController do ...@@ -27,6 +27,7 @@ RSpec.describe Projects::ProtectedBranchesController do
{ merge_access_levels_attributes: maintainer_access_level, { merge_access_levels_attributes: maintainer_access_level,
push_access_levels_attributes: maintainer_access_level } push_access_levels_attributes: maintainer_access_level }
end end
let(:create_params) { attributes_for(:protected_branch).merge(access_level_params) } let(:create_params) { attributes_for(:protected_branch).merge(access_level_params) }
before do before do
......
...@@ -18,6 +18,7 @@ RSpec.describe Projects::Serverless::FunctionsController do ...@@ -18,6 +18,7 @@ RSpec.describe Projects::Serverless::FunctionsController do
let(:knative_stub_options) do let(:knative_stub_options) do
{ namespace: namespace.namespace, name: function_name, description: function_description } { namespace: namespace.namespace, name: function_name, description: function_description }
end end
let(:knative) { create(:clusters_applications_knative, :installed, cluster: cluster) } let(:knative) { create(:clusters_applications_knative, :installed, cluster: cluster) }
let(:namespace) do let(:namespace) do
......
...@@ -56,6 +56,7 @@ RSpec.describe Projects::Settings::RepositoryController do ...@@ -56,6 +56,7 @@ RSpec.describe Projects::Settings::RepositoryController do
deploy_token_type: DeployToken.deploy_token_types[:project_type] deploy_token_type: DeployToken.deploy_token_types[:project_type]
} }
end end
let(:request_params) do let(:request_params) do
{ {
namespace_id: project.namespace.to_param, namespace_id: project.namespace.to_param,
......
...@@ -47,6 +47,7 @@ RSpec.describe Projects::VariablesController do ...@@ -47,6 +47,7 @@ RSpec.describe Projects::VariablesController do
protected: variable.protected?.to_s, protected: variable.protected?.to_s,
environment_scope: variable.environment_scope } environment_scope: variable.environment_scope }
end end
let(:new_variable_attributes) do let(:new_variable_attributes) do
{ key: 'new_key', { key: 'new_key',
secret_value: 'dummy_value', secret_value: 'dummy_value',
......
...@@ -17,6 +17,7 @@ RSpec.describe Repositories::GitHttpController do ...@@ -17,6 +17,7 @@ RSpec.describe Repositories::GitHttpController do
repository_id: repository_id repository_id: repository_id
} }
end end
let(:params) { container_params } let(:params) { container_params }
describe 'HEAD #info_refs' do describe 'HEAD #info_refs' do
......
...@@ -216,6 +216,7 @@ RSpec.describe SentNotificationsController do ...@@ -216,6 +216,7 @@ RSpec.describe SentNotificationsController do
merge_request.subscriptions.create(user: user, project: project, subscribed: true) merge_request.subscriptions.create(user: user, project: project, subscribed: true)
end end
end end
let(:sent_notification) { create(:sent_notification, project: project, noteable: merge_request, recipient: user) } let(:sent_notification) { create(:sent_notification, project: project, noteable: merge_request, recipient: user) }
before do before do
......
...@@ -196,6 +196,7 @@ RSpec.describe 'Admin Mode Login', :clean_gitlab_redis_shared_state, :do_not_moc ...@@ -196,6 +196,7 @@ RSpec.describe 'Admin Mode Login', :clean_gitlab_redis_shared_state, :do_not_moc
'base' => 'dc=example,dc=com' 'base' => 'dc=example,dc=com'
} }
end end
let(:user) { create(:omniauth_user, :admin, :two_factor, extern_uid: uid, provider: provider) } let(:user) { create(:omniauth_user, :admin, :two_factor, extern_uid: uid, provider: provider) }
before do before do
......
...@@ -30,6 +30,7 @@ RSpec.describe "User Feed" do ...@@ -30,6 +30,7 @@ RSpec.describe "User Feed" do
author: user, author: user,
description: "Houston, we have a bug!\n\n***\n\nI guess.") description: "Houston, we have a bug!\n\n***\n\nI guess.")
end end
let(:note) do let(:note) do
create(:note, create(:note,
noteable: issue, noteable: issue,
...@@ -37,6 +38,7 @@ RSpec.describe "User Feed" do ...@@ -37,6 +38,7 @@ RSpec.describe "User Feed" do
note: 'Bug confirmed :+1:', note: 'Bug confirmed :+1:',
project: project) project: project)
end end
let(:merge_request) do let(:merge_request) do
create(:merge_request, create(:merge_request,
title: 'Fix bug', title: 'Fix bug',
...@@ -45,6 +47,7 @@ RSpec.describe "User Feed" do ...@@ -45,6 +47,7 @@ RSpec.describe "User Feed" do
target_project: project, target_project: project,
description: "Here is the fix: ![an image](image.png)") description: "Here is the fix: ![an image](image.png)")
end end
let(:push_event) { create(:push_event, project: project, author: user) } let(:push_event) { create(:push_event, project: project, author: user) }
let!(:push_event_payload) { create(:push_event_payload, event: push_event) } let!(:push_event_payload) { create(:push_event_payload, event: push_event) }
......
...@@ -83,6 +83,7 @@ RSpec.describe 'Metrics rendering', :js, :kubeclient, :use_clean_rails_memory_st ...@@ -83,6 +83,7 @@ RSpec.describe 'Metrics rendering', :js, :kubeclient, :use_clean_rails_memory_st
y_label: 'Total Cores' y_label: 'Total Cores'
} }
end end
let(:metrics_url_2) { urls.metrics_project_environment_url(project, environment, **chart_params_2) } let(:metrics_url_2) { urls.metrics_project_environment_url(project, environment, **chart_params_2) }
let(:description) { "See [metrics dashboard](#{metrics_url}) for info. \n See [metrics dashboard](#{metrics_url_2}) for info." } let(:description) { "See [metrics dashboard](#{metrics_url}) for info. \n See [metrics dashboard](#{metrics_url_2}) for info." }
let(:issue) { create(:issue, project: project, description: description) } let(:issue) { create(:issue, project: project, description: description) }
......
...@@ -10,6 +10,7 @@ RSpec.describe 'User comments on a diff', :js do ...@@ -10,6 +10,7 @@ RSpec.describe 'User comments on a diff', :js do
let(:merge_request) do let(:merge_request) do
create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test') create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test')
end end
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
......
...@@ -15,6 +15,7 @@ RSpec.describe 'Merge request < User customizes merge commit message', :js do ...@@ -15,6 +15,7 @@ RSpec.describe 'Merge request < User customizes merge commit message', :js do
description: "Description\n\nclosing #{issue_1.to_reference}, #{issue_2.to_reference}" description: "Description\n\nclosing #{issue_1.to_reference}, #{issue_2.to_reference}"
) )
end end
let(:textbox) { page.find(:css, '#merge-message-edit', visible: false) } let(:textbox) { page.find(:css, '#merge-message-edit', visible: false) }
let(:default_message) do let(:default_message) do
[ [
...@@ -24,6 +25,7 @@ RSpec.describe 'Merge request < User customizes merge commit message', :js do ...@@ -24,6 +25,7 @@ RSpec.describe 'Merge request < User customizes merge commit message', :js do
"See merge request #{merge_request.to_reference(full: true)}" "See merge request #{merge_request.to_reference(full: true)}"
].join("\n\n") ].join("\n\n")
end end
let(:message_with_description) do let(:message_with_description) do
[ [
"Merge branch 'feature' into 'master'", "Merge branch 'feature' into 'master'",
......
...@@ -12,6 +12,7 @@ RSpec.describe 'Merge requests > User merges immediately', :js do ...@@ -12,6 +12,7 @@ RSpec.describe 'Merge requests > User merges immediately', :js do
head_pipeline: pipeline, head_pipeline: pipeline,
source_branch: pipeline.ref) source_branch: pipeline.ref)
end end
let(:pipeline) do let(:pipeline) do
create(:ci_pipeline, project: project, create(:ci_pipeline, project: project,
ref: 'master', ref: 'master',
......
...@@ -11,6 +11,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do ...@@ -11,6 +11,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do
title: 'Bug NS-04', title: 'Bug NS-04',
merge_params: { force_remove_source_branch: '1' }) merge_params: { force_remove_source_branch: '1' })
end end
let(:pipeline) do let(:pipeline) do
create(:ci_pipeline, project: project, create(:ci_pipeline, project: project,
sha: merge_request.diff_head_sha, sha: merge_request.diff_head_sha,
...@@ -115,6 +116,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do ...@@ -115,6 +116,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do
merge_user: user, merge_user: user,
title: 'MepMep') title: 'MepMep')
end end
let!(:build) do let!(:build) do
create(:ci_build, pipeline: pipeline) create(:ci_build, pipeline: pipeline)
end end
......
...@@ -10,6 +10,7 @@ RSpec.describe 'Merge request > User posts notes', :js do ...@@ -10,6 +10,7 @@ RSpec.describe 'Merge request > User posts notes', :js do
let(:merge_request) do let(:merge_request) do
create(:merge_request, source_project: project, target_project: project) create(:merge_request, source_project: project, target_project: project)
end end
let!(:note) do let!(:note) do
create(:note_on_merge_request, :with_attachment, noteable: merge_request, create(:note_on_merge_request, :with_attachment, noteable: merge_request,
project: project) project: project)
......
...@@ -11,6 +11,7 @@ RSpec.describe 'Merge request > User resolves Work in Progress', :js do ...@@ -11,6 +11,7 @@ RSpec.describe 'Merge request > User resolves Work in Progress', :js do
title: 'WIP: Bug NS-04', title: 'WIP: Bug NS-04',
merge_params: { force_remove_source_branch: '1' }) merge_params: { force_remove_source_branch: '1' })
end end
let(:pipeline) do let(:pipeline) do
create(:ci_pipeline, project: project, create(:ci_pipeline, project: project,
sha: merge_request.diff_head_sha, sha: merge_request.diff_head_sha,
......
...@@ -16,6 +16,7 @@ RSpec.describe 'Merge request > User sees avatars on diff notes', :js do ...@@ -16,6 +16,7 @@ RSpec.describe 'Merge request > User sees avatars on diff notes', :js do
diff_refs: merge_request.diff_refs diff_refs: merge_request.diff_refs
) )
end end
let!(:note) { create(:diff_note_on_merge_request, project: project, noteable: merge_request, position: position) } let!(:note) { create(:diff_note_on_merge_request, project: project, noteable: merge_request, position: position) }
before do before do
......
...@@ -16,6 +16,7 @@ RSpec.describe 'Merge request > User sees closing issues message', :js do ...@@ -16,6 +16,7 @@ RSpec.describe 'Merge request > User sees closing issues message', :js do
title: merge_request_title title: merge_request_title
) )
end end
let(:merge_request_description) { 'Merge Request Description' } let(:merge_request_description) { 'Merge Request Description' }
let(:merge_request_title) { 'Merge Request Title' } let(:merge_request_title) { 'Merge Request Title' }
......
...@@ -24,6 +24,7 @@ RSpec.describe 'Merge request > User sees threads', :js do ...@@ -24,6 +24,7 @@ RSpec.describe 'Merge request > User sees threads', :js do
diff_refs: outdated_diff_refs diff_refs: outdated_diff_refs
) )
end end
let(:outdated_diff_refs) { project.commit("874797c3a73b60d2187ed6e2fcabd289ff75171e").diff_refs } let(:outdated_diff_refs) { project.commit("874797c3a73b60d2187ed6e2fcabd289ff75171e").diff_refs }
before do before do
......
...@@ -53,6 +53,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', ...@@ -53,6 +53,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request',
Ci::CreatePipelineService.new(project, user, ref: 'feature') Ci::CreatePipelineService.new(project, user, ref: 'feature')
.execute(:merge_request_event, merge_request: merge_request) .execute(:merge_request_event, merge_request: merge_request)
end end
let(:enable_mr_tabs_position_flag) { false } let(:enable_mr_tabs_position_flag) { false }
before do before do
......
...@@ -13,6 +13,7 @@ RSpec.describe 'Merge request > User sees pipelines from forked project', :js do ...@@ -13,6 +13,7 @@ RSpec.describe 'Merge request > User sees pipelines from forked project', :js do
target_project: target_project, target_project: target_project,
description: 'Test merge request') description: 'Test merge request')
end end
let(:pipeline) do let(:pipeline) do
create(:ci_pipeline, create(:ci_pipeline,
project: forked_project, project: forked_project,
......
...@@ -8,6 +8,7 @@ RSpec.describe 'Merge request > User sees versions', :js do ...@@ -8,6 +8,7 @@ RSpec.describe 'Merge request > User sees versions', :js do
mr.merge_request_diff.destroy mr.merge_request_diff.destroy
end end
end end
let(:project) { merge_request.source_project } let(:project) { merge_request.source_project }
let(:user) { project.creator } let(:user) { project.creator }
let!(:merge_request_diff1) { merge_request.merge_request_diffs.create(head_commit_sha: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9') } let!(:merge_request_diff1) { merge_request.merge_request_diffs.create(head_commit_sha: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9') }
......
...@@ -22,6 +22,7 @@ RSpec.describe 'User comments on a diff', :js do ...@@ -22,6 +22,7 @@ RSpec.describe 'User comments on a diff', :js do
let(:merge_request) do let(:merge_request) do
create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test') create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test')
end end
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
......
...@@ -10,6 +10,7 @@ RSpec.describe 'Merge Request > User tries to access private project information ...@@ -10,6 +10,7 @@ RSpec.describe 'Merge Request > User tries to access private project information
name: 'nothing to see here', name: 'nothing to see here',
repository_access_level: ProjectFeature::PRIVATE) repository_access_level: ProjectFeature::PRIVATE)
end end
let(:owned_project) do let(:owned_project) do
create(:project, :public, :repository, create(:project, :public, :repository,
namespace: current_user.namespace, namespace: current_user.namespace,
......
...@@ -6,6 +6,7 @@ RSpec.describe 'User views diffs file-by-file', :js do ...@@ -6,6 +6,7 @@ RSpec.describe 'User views diffs file-by-file', :js do
let(:merge_request) do let(:merge_request) do
create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test') create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test')
end end
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:user) { create(:user, view_diffs_file_by_file: true) } let(:user) { create(:user, view_diffs_file_by_file: true) }
......
...@@ -6,6 +6,7 @@ RSpec.describe 'User views diffs', :js do ...@@ -6,6 +6,7 @@ RSpec.describe 'User views diffs', :js do
let(:merge_request) do let(:merge_request) do
create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test') create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test')
end end
let(:project) { create(:project, :public, :repository) } let(:project) { create(:project, :public, :repository) }
let(:view) { 'inline' } let(:view) { 'inline' }
......
...@@ -6,6 +6,7 @@ RSpec.describe 'User views diff by commit', :js do ...@@ -6,6 +6,7 @@ RSpec.describe 'User views diff by commit', :js do
let(:merge_request) do let(:merge_request) do
create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test') create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test')
end end
let(:project) { create(:project, :public, :repository) } let(:project) { create(:project, :public, :repository) }
before do before do
......
...@@ -14,6 +14,7 @@ RSpec.describe 'Profile > Chat' do ...@@ -14,6 +14,7 @@ RSpec.describe 'Profile > Chat' do
let(:params) do let(:params) do
{ team_id: 'T00', team_domain: 'my_chat_team', user_id: 'U01', user_name: 'my_chat_user' } { team_id: 'T00', team_domain: 'my_chat_team', user_id: 'U01', user_name: 'my_chat_user' }
end end
let!(:authorize_url) { ChatNames::AuthorizeUserService.new(service, params).execute } let!(:authorize_url) { ChatNames::AuthorizeUserService.new(service, params).execute }
let(:authorize_path) { URI.parse(authorize_url).request_uri } let(:authorize_path) { URI.parse(authorize_url).request_uri }
......
...@@ -6,6 +6,7 @@ RSpec.describe 'Classification label on project pages' do ...@@ -6,6 +6,7 @@ RSpec.describe 'Classification label on project pages' do
let(:project) do let(:project) do
create(:project, external_authorization_classification_label: 'authorized label') create(:project, external_authorization_classification_label: 'authorized label')
end end
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
......
...@@ -12,6 +12,7 @@ RSpec.describe 'Mini Pipeline Graph in Commit View', :js do ...@@ -12,6 +12,7 @@ RSpec.describe 'Mini Pipeline Graph in Commit View', :js do
ref: project.default_branch, ref: project.default_branch,
sha: project.commit.sha) sha: project.commit.sha)
end end
let(:build) { create(:ci_build, pipeline: pipeline) } let(:build) { create(:ci_build, pipeline: pipeline) }
it 'display icon with status' do it 'display icon with status' do
......
...@@ -9,6 +9,7 @@ RSpec.describe "User browses files" do ...@@ -9,6 +9,7 @@ RSpec.describe "User browses files" do
"You're not allowed to make changes to this project directly. "\ "You're not allowed to make changes to this project directly. "\
"A fork of this project has been created that you can make changes in, so you can submit a merge request." "A fork of this project has been created that you can make changes in, so you can submit a merge request."
end end
let(:project) { create(:project, :repository, name: "Shop") } let(:project) { create(:project, :repository, name: "Shop") }
let(:project2) { create(:project, :repository, name: "Another Project", path: "another-project") } let(:project2) { create(:project, :repository, name: "Another Project", path: "another-project") }
let(:tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) } let(:tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) }
......
...@@ -7,6 +7,7 @@ RSpec.describe 'Projects > Files > User creates a directory', :js do ...@@ -7,6 +7,7 @@ RSpec.describe 'Projects > Files > User creates a directory', :js do
"You're not allowed to make changes to this project directly. "\ "You're not allowed to make changes to this project directly. "\
"A fork of this project has been created that you can make changes in, so you can submit a merge request." "A fork of this project has been created that you can make changes in, so you can submit a merge request."
end end
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') } let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') }
let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) } let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) }
......
...@@ -7,6 +7,7 @@ RSpec.describe 'Projects > Files > User creates files', :js do ...@@ -7,6 +7,7 @@ RSpec.describe 'Projects > Files > User creates files', :js do
"You're not allowed to make changes to this project directly. "\ "You're not allowed to make changes to this project directly. "\
"A fork of this project has been created that you can make changes in, so you can submit a merge request." "A fork of this project has been created that you can make changes in, so you can submit a merge request."
end end
let(:project) { create(:project, :repository, name: 'Shop') } let(:project) { create(:project, :repository, name: 'Shop') }
let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') } let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') }
let(:project_tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) } let(:project_tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) }
......
...@@ -7,6 +7,7 @@ RSpec.describe 'Projects > Files > User deletes files', :js do ...@@ -7,6 +7,7 @@ RSpec.describe 'Projects > Files > User deletes files', :js do
"You're not allowed to make changes to this project directly. "\ "You're not allowed to make changes to this project directly. "\
"A fork of this project has been created that you can make changes in, so you can submit a merge request." "A fork of this project has been created that you can make changes in, so you can submit a merge request."
end end
let(:project) { create(:project, :repository, name: 'Shop') } let(:project) { create(:project, :repository, name: 'Shop') }
let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') } let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') }
let(:project_tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) } let(:project_tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) }
......
...@@ -9,6 +9,7 @@ RSpec.describe 'Projects > Files > User replaces files', :js do ...@@ -9,6 +9,7 @@ RSpec.describe 'Projects > Files > User replaces files', :js do
"You're not allowed to make changes to this project directly. "\ "You're not allowed to make changes to this project directly. "\
"A fork of this project has been created that you can make changes in, so you can submit a merge request." "A fork of this project has been created that you can make changes in, so you can submit a merge request."
end end
let(:project) { create(:project, :repository, name: 'Shop') } let(:project) { create(:project, :repository, name: 'Shop') }
let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') } let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') }
let(:project_tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) } let(:project_tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) }
......
...@@ -19,6 +19,7 @@ RSpec.describe 'Import/Export - project export integration test', :js do ...@@ -19,6 +19,7 @@ RSpec.describe 'Import/Export - project export integration test', :js do
key: [Project, Ci::Variable, :yaml_variables] key: [Project, Ci::Variable, :yaml_variables]
} }
end end
let(:safe_hashes) { { yaml_variables: %w[key value public] } } let(:safe_hashes) { { yaml_variables: %w[key value public] } }
let(:project) { setup_project } let(:project) { setup_project }
......
...@@ -11,33 +11,39 @@ RSpec.describe 'viewing an issue with cross project references' do ...@@ -11,33 +11,39 @@ RSpec.describe 'viewing an issue with cross project references' do
create(:project, :public, create(:project, :public,
external_authorization_classification_label: 'other_label') external_authorization_classification_label: 'other_label')
end end
let(:other_issue) do let(:other_issue) do
create(:issue, :closed, create(:issue, :closed,
title: 'I am in another project', title: 'I am in another project',
project: other_project) project: other_project)
end end
let(:other_confidential_issue) do let(:other_confidential_issue) do
create(:issue, :confidential, :closed, create(:issue, :confidential, :closed,
title: 'I am in another project and confidential', title: 'I am in another project and confidential',
project: other_project) project: other_project)
end end
let(:other_merge_request) do let(:other_merge_request) do
create(:merge_request, :closed, create(:merge_request, :closed,
title: 'I am a merge request in another project', title: 'I am a merge request in another project',
source_project: other_project) source_project: other_project)
end end
let(:description_referencing_other_issue) do let(:description_referencing_other_issue) do
"Referencing: #{other_issue.to_reference(project)}, "\ "Referencing: #{other_issue.to_reference(project)}, "\
"a confidential issue #{confidential_issue.to_reference}, "\ "a confidential issue #{confidential_issue.to_reference}, "\
"a cross project confidential issue #{other_confidential_issue.to_reference(project)}, and "\ "a cross project confidential issue #{other_confidential_issue.to_reference(project)}, and "\
"a cross project merge request #{other_merge_request.to_reference(project)}" "a cross project merge request #{other_merge_request.to_reference(project)}"
end end
let(:project) { create(:project) } let(:project) { create(:project) }
let(:issue) do let(:issue) do
create(:issue, create(:issue,
project: project, project: project,
description: description_referencing_other_issue ) description: description_referencing_other_issue )
end end
let(:confidential_issue) do let(:confidential_issue) do
create(:issue, :confidential, :closed, create(:issue, :confidential, :closed,
title: "I am in the same project and confidential", title: "I am in the same project and confidential",
......
...@@ -137,6 +137,7 @@ RSpec.describe 'Pipeline', :js do ...@@ -137,6 +137,7 @@ RSpec.describe 'Pipeline', :js do
source_project: project, source_project: project,
source_branch: pipeline.ref) source_branch: pipeline.ref)
end end
let!(:merge_request2) do let!(:merge_request2) do
create(:merge_request, create(:merge_request,
source_project: project, source_project: project,
......
...@@ -11,9 +11,11 @@ RSpec.describe 'User views wiki pages' do ...@@ -11,9 +11,11 @@ RSpec.describe 'User views wiki pages' do
let!(:wiki_page1) do let!(:wiki_page1) do
create(:wiki_page, wiki: project.wiki, title: '3 home', content: '3') create(:wiki_page, wiki: project.wiki, title: '3 home', content: '3')
end end
let!(:wiki_page2) do let!(:wiki_page2) do
create(:wiki_page, wiki: project.wiki, title: '1 home', content: '1') create(:wiki_page, wiki: project.wiki, title: '1 home', content: '1')
end end
let!(:wiki_page3) do let!(:wiki_page3) do
create(:wiki_page, wiki: project.wiki, title: '2 home', content: '2') create(:wiki_page, wiki: project.wiki, title: '2 home', content: '2')
end end
......
...@@ -10,15 +10,19 @@ RSpec.describe ForkTargetsFinder do ...@@ -10,15 +10,19 @@ RSpec.describe ForkTargetsFinder do
let!(:maintained_group) do let!(:maintained_group) do
create(:group).tap { |g| g.add_maintainer(user) } create(:group).tap { |g| g.add_maintainer(user) }
end end
let!(:owned_group) do let!(:owned_group) do
create(:group).tap { |g| g.add_owner(user) } create(:group).tap { |g| g.add_owner(user) }
end end
let!(:developer_group) do let!(:developer_group) do
create(:group).tap { |g| g.add_developer(user) } create(:group).tap { |g| g.add_developer(user) }
end end
let!(:reporter_group) do let!(:reporter_group) do
create(:group).tap { |g| g.add_reporter(user) } create(:group).tap { |g| g.add_reporter(user) }
end end
let!(:guest_group) do let!(:guest_group) do
create(:group).tap { |g| g.add_guest(user) } create(:group).tap { |g| g.add_guest(user) }
end end
......
...@@ -38,6 +38,7 @@ RSpec.describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: ...@@ -38,6 +38,7 @@ RSpec.describe Projects::MergeRequestsController, '(JavaScript fixtures)', type:
sha: merge_request.diff_head_sha sha: merge_request.diff_head_sha
) )
end end
let(:path) { "files/ruby/popen.rb" } let(:path) { "files/ruby/popen.rb" }
let(:position) do let(:position) do
build(:text_diff_position, :added, build(:text_diff_position, :added,
......
...@@ -257,6 +257,7 @@ RSpec.describe 'Gitlab::Graphql::Authorization' do ...@@ -257,6 +257,7 @@ RSpec.describe 'Gitlab::Graphql::Authorization' do
type.field :id, GraphQL::ID_TYPE, null: false type.field :id, GraphQL::ID_TYPE, null: false
end end
end end
let(:project_type) do |type| let(:project_type) do |type|
type_factory do |type| type_factory do |type|
type.graphql_name 'FakeProjectType' type.graphql_name 'FakeProjectType'
...@@ -264,11 +265,13 @@ RSpec.describe 'Gitlab::Graphql::Authorization' do ...@@ -264,11 +265,13 @@ RSpec.describe 'Gitlab::Graphql::Authorization' do
resolve: -> (_, _, _) { Issue.where(project: [visible_project, other_project]).order(id: :asc) } resolve: -> (_, _, _) { Issue.where(project: [visible_project, other_project]).order(id: :asc) }
end end
end end
let(:query_type) do let(:query_type) do
query_factory do |query| query_factory do |query|
query.field :test_project, project_type, null: false, resolve: -> (_, _, _) { visible_project } query.field :test_project, project_type, null: false, resolve: -> (_, _, _) { visible_project }
end end
end end
let(:query_string) do let(:query_string) do
<<~QRY <<~QRY
{ testProject { testIssues(first: 3) { edges { node { id } } } } } { testProject { testIssues(first: 3) { edges { node { id } } } } }
......
...@@ -17,6 +17,7 @@ RSpec.describe Mutations::Issues::Update do ...@@ -17,6 +17,7 @@ RSpec.describe Mutations::Issues::Update do
discussion_locked: true discussion_locked: true
} }
end end
let(:mutation) { described_class.new(object: nil, context: { current_user: user }, field: nil) } let(:mutation) { described_class.new(object: nil, context: { current_user: user }, field: nil) }
let(:mutated_issue) { subject[:issue] } let(:mutated_issue) { subject[:issue] }
......
...@@ -18,6 +18,7 @@ RSpec.describe Resolvers::CommitPipelinesResolver do ...@@ -18,6 +18,7 @@ RSpec.describe Resolvers::CommitPipelinesResolver do
status: 'success' status: 'success'
) )
end end
let!(:pipeline2) do let!(:pipeline2) do
create( create(
:ci_pipeline, :ci_pipeline,
...@@ -27,6 +28,7 @@ RSpec.describe Resolvers::CommitPipelinesResolver do ...@@ -27,6 +28,7 @@ RSpec.describe Resolvers::CommitPipelinesResolver do
status: 'failed' status: 'failed'
) )
end end
let!(:pipeline3) do let!(:pipeline3) do
create( create(
:ci_pipeline, :ci_pipeline,
......
...@@ -10,6 +10,7 @@ RSpec.describe GitlabSchema.types['DesignAtVersion'] do ...@@ -10,6 +10,7 @@ RSpec.describe GitlabSchema.types['DesignAtVersion'] do
version = design.versions.first version = design.versions.first
GitlabSchema.id_from_object(create(:design_at_version, design: design, version: version)) GitlabSchema.id_from_object(create(:design_at_version, design: design, version: version))
end end
let_it_be(:object_id_b) { GitlabSchema.id_from_object(create(:design_at_version)) } let_it_be(:object_id_b) { GitlabSchema.id_from_object(create(:design_at_version)) }
let(:object_type) { ::Types::DesignManagement::DesignAtVersionType } let(:object_type) { ::Types::DesignManagement::DesignAtVersionType }
end end
......
...@@ -33,6 +33,7 @@ RSpec.describe GitlabSchema.types['Snippet'] do ...@@ -33,6 +33,7 @@ RSpec.describe GitlabSchema.types['Snippet'] do
} }
) )
end end
let(:response) { subject.dig('data', 'snippets', 'nodes')[0] } let(:response) { subject.dig('data', 'snippets', 'nodes')[0] }
subject { GitlabSchema.execute(query, context: { current_user: current_user }).as_json } subject { GitlabSchema.execute(query, context: { current_user: current_user }).as_json }
...@@ -97,6 +98,7 @@ RSpec.describe GitlabSchema.types['Snippet'] do ...@@ -97,6 +98,7 @@ RSpec.describe GitlabSchema.types['Snippet'] do
} }
) )
end end
let(:response) { subject.dig('data', 'snippets', 'nodes')[0] } let(:response) { subject.dig('data', 'snippets', 'nodes')[0] }
subject { GitlabSchema.execute(query, context: { current_user: user }).as_json } subject { GitlabSchema.execute(query, context: { current_user: user }).as_json }
......
...@@ -11,6 +11,7 @@ RSpec.describe BlameHelper do ...@@ -11,6 +11,7 @@ RSpec.describe BlameHelper do
Time.zone.local(2013, 2, 24, 0, 0, 0), Time.zone.local(2013, 2, 24, 0, 0, 0),
Time.zone.local(2010, 9, 22, 0, 0, 0)] Time.zone.local(2010, 9, 22, 0, 0, 0)]
end end
let(:blame_groups) do let(:blame_groups) do
[ [
{ commit: double(committed_date: dates[0]) }, { commit: double(committed_date: dates[0]) },
...@@ -57,6 +58,7 @@ RSpec.describe BlameHelper do ...@@ -57,6 +58,7 @@ RSpec.describe BlameHelper do
project = double(created_at: now) project = double(created_at: now)
helper.age_map_duration(today_blame_groups, project) helper.age_map_duration(today_blame_groups, project)
end end
let(:today_blame_groups) { [{ commit: double(committed_date: now) }] } let(:today_blame_groups) { [{ commit: double(committed_date: now) }] }
let(:now) { Time.zone.now } let(:now) { Time.zone.now }
......
...@@ -114,12 +114,14 @@ RSpec.describe GroupsHelper do ...@@ -114,12 +114,14 @@ RSpec.describe GroupsHelper do
ancestor_locked_and_has_been_overridden: /This setting is applied on .+ and has been overridden on this subgroup/ ancestor_locked_and_has_been_overridden: /This setting is applied on .+ and has been overridden on this subgroup/
} }
end end
let(:possible_linked_ancestors) do let(:possible_linked_ancestors) do
{ {
root_group: root_group, root_group: root_group,
subgroup: subgroup subgroup: subgroup
} }
end end
let(:users) do let(:users) do
{ {
root_owner: root_owner, root_owner: root_owner,
......
...@@ -10,6 +10,7 @@ RSpec.describe NamespacesHelper do ...@@ -10,6 +10,7 @@ RSpec.describe NamespacesHelper do
:private, :private,
project_creation_level: admin_project_creation_level) project_creation_level: admin_project_creation_level)
end end
let!(:user) { create(:user) } let!(:user) { create(:user) }
let!(:user_project_creation_level) { nil } let!(:user_project_creation_level) { nil }
let!(:user_group) do let!(:user_group) do
...@@ -17,18 +18,21 @@ RSpec.describe NamespacesHelper do ...@@ -17,18 +18,21 @@ RSpec.describe NamespacesHelper do
:private, :private,
project_creation_level: user_project_creation_level) project_creation_level: user_project_creation_level)
end end
let!(:subgroup1) do let!(:subgroup1) do
create(:group, create(:group,
:private, :private,
parent: admin_group, parent: admin_group,
project_creation_level: nil) project_creation_level: nil)
end end
let!(:subgroup2) do let!(:subgroup2) do
create(:group, create(:group,
:private, :private,
parent: admin_group, parent: admin_group,
project_creation_level: ::Gitlab::Access::DEVELOPER_MAINTAINER_PROJECT_ACCESS) project_creation_level: ::Gitlab::Access::DEVELOPER_MAINTAINER_PROJECT_ACCESS)
end end
let!(:subgroup3) do let!(:subgroup3) do
create(:group, create(:group,
:private, :private,
......
...@@ -34,6 +34,7 @@ RSpec.describe API::Entities::Nuget::DependencyGroup do ...@@ -34,6 +34,7 @@ RSpec.describe API::Entities::Nuget::DependencyGroup do
] ]
} }
end end
let(:entity) { described_class.new(dependency_group) } let(:entity) { described_class.new(dependency_group) }
subject { entity.as_json } subject { entity.as_json }
......
...@@ -20,6 +20,7 @@ RSpec.describe API::Entities::Nuget::Dependency do ...@@ -20,6 +20,7 @@ RSpec.describe API::Entities::Nuget::Dependency do
'range': '2.0.0' 'range': '2.0.0'
} }
end end
let(:entity) { described_class.new(dependency) } let(:entity) { described_class.new(dependency) }
subject { entity.as_json } subject { entity.as_json }
......
...@@ -10,6 +10,7 @@ RSpec.describe API::Entities::Nuget::Metadatum do ...@@ -10,6 +10,7 @@ RSpec.describe API::Entities::Nuget::Metadatum do
icon_url: 'http://sandbox.com/icon' icon_url: 'http://sandbox.com/icon'
} }
end end
let(:expected) do let(:expected) do
{ {
'projectUrl': 'http://sandbox.com/project', 'projectUrl': 'http://sandbox.com/project',
...@@ -17,6 +18,7 @@ RSpec.describe API::Entities::Nuget::Metadatum do ...@@ -17,6 +18,7 @@ RSpec.describe API::Entities::Nuget::Metadatum do
'iconUrl': 'http://sandbox.com/icon' 'iconUrl': 'http://sandbox.com/icon'
} }
end end
let(:entity) { described_class.new(metadatum) } let(:entity) { described_class.new(metadatum) }
subject { entity.as_json } subject { entity.as_json }
......
...@@ -27,6 +27,7 @@ RSpec.describe API::Entities::Nuget::SearchResult do ...@@ -27,6 +27,7 @@ RSpec.describe API::Entities::Nuget::SearchResult do
} }
} }
end end
let(:expected) do let(:expected) do
{ {
'@type': 'Package', '@type': 'Package',
......
...@@ -12,6 +12,7 @@ RSpec.describe Banzai::Filter::AbsoluteLinkFilter do ...@@ -12,6 +12,7 @@ RSpec.describe Banzai::Filter::AbsoluteLinkFilter do
let(:only_path_context) do let(:only_path_context) do
{ only_path: false } { only_path: false }
end end
let(:fake_url) { 'http://www.example.com' } let(:fake_url) { 'http://www.example.com' }
before do before do
......
...@@ -220,6 +220,7 @@ RSpec.describe Banzai::Filter::MergeRequestReferenceFilter do ...@@ -220,6 +220,7 @@ RSpec.describe Banzai::Filter::MergeRequestReferenceFilter do
let(:reference) do let(:reference) do
urls.project_merge_request_url(mr.project, mr) + "/diffs?commit_id=#{mr.diff_head_sha}" urls.project_merge_request_url(mr.project, mr) + "/diffs?commit_id=#{mr.diff_head_sha}"
end end
let(:commit) { mr.commits.find { |commit| commit.sha == mr.diff_head_sha } } let(:commit) { mr.commits.find { |commit| commit.sha == mr.diff_head_sha } }
it 'links to a valid reference' do it 'links to a valid reference' do
......
...@@ -13,6 +13,7 @@ RSpec.describe Banzai::IssuableExtractor do ...@@ -13,6 +13,7 @@ RSpec.describe Banzai::IssuableExtractor do
"<a href='' data-issue='#{issue.id}' data-reference-type='issue' class='gfm'>text</a>" "<a href='' data-issue='#{issue.id}' data-reference-type='issue' class='gfm'>text</a>"
) )
end end
let(:merge_request_link) do let(:merge_request_link) do
html_to_node( html_to_node(
"<a href='' data-merge-request='#{merge_request.id}' data-reference-type='merge_request' class='gfm'>text</a>" "<a href='' data-merge-request='#{merge_request.id}' data-reference-type='merge_request' class='gfm'>text</a>"
......
...@@ -73,6 +73,7 @@ RSpec.describe Banzai::ObjectRenderer do ...@@ -73,6 +73,7 @@ RSpec.describe Banzai::ObjectRenderer do
end end
end end
end end
let(:cacheless_thing) do let(:cacheless_thing) do
cacheless_class.new.tap do |thing| cacheless_class.new.tap do |thing|
thing.title = "Merge branch 'branch-merged' into 'master'" thing.title = "Merge branch 'branch-merged' into 'master'"
......
...@@ -109,6 +109,7 @@ RSpec.describe Banzai::Pipeline::FullPipeline do ...@@ -109,6 +109,7 @@ RSpec.describe Banzai::Pipeline::FullPipeline do
# Header # Header
MARKDOWN MARKDOWN
end end
let(:invalid_markdown) do let(:invalid_markdown) do
<<-MARKDOWN.strip_heredoc <<-MARKDOWN.strip_heredoc
test [[_TOC_]] test [[_TOC_]]
......
...@@ -14,6 +14,7 @@ RSpec.describe ContainerRegistry::Client do ...@@ -14,6 +14,7 @@ RSpec.describe ContainerRegistry::Client do
'User-Agent' => "GitLab/#{Gitlab::VERSION}" 'User-Agent' => "GitLab/#{Gitlab::VERSION}"
} }
end end
let(:headers_with_accept_types) do let(:headers_with_accept_types) do
{ {
'Accept' => 'application/vnd.docker.distribution.manifest.v2+json, application/vnd.oci.image.manifest.v1+json', 'Accept' => 'application/vnd.docker.distribution.manifest.v2+json, application/vnd.oci.image.manifest.v1+json',
......
...@@ -18,6 +18,7 @@ RSpec.describe Gitlab::AlertManagement::AlertParams do ...@@ -18,6 +18,7 @@ RSpec.describe Gitlab::AlertManagement::AlertParams do
'some' => { 'extra' => { 'payload' => 'here' } } 'some' => { 'extra' => { 'payload' => 'here' } }
} }
end end
let(:payload) { default_payload } let(:payload) { default_payload }
subject { described_class.from_generic_alert(project: project, payload: payload) } subject { described_class.from_generic_alert(project: project, payload: payload) }
...@@ -75,6 +76,7 @@ RSpec.describe Gitlab::AlertManagement::AlertParams do ...@@ -75,6 +76,7 @@ RSpec.describe Gitlab::AlertManagement::AlertParams do
'fingerprint' => 'b6ac4d42057c43c1' 'fingerprint' => 'b6ac4d42057c43c1'
} }
end end
let(:parsed_alert) { Gitlab::Alerting::Alert.new(project: project, payload: payload) } let(:parsed_alert) { Gitlab::Alerting::Alert.new(project: project, payload: payload) }
subject { described_class.from_prometheus_alert(project: project, parsed_alert: parsed_alert) } subject { described_class.from_prometheus_alert(project: project, parsed_alert: parsed_alert) }
......
...@@ -14,6 +14,7 @@ RSpec.describe Gitlab::ApplicationRateLimiter, :clean_gitlab_redis_cache do ...@@ -14,6 +14,7 @@ RSpec.describe Gitlab::ApplicationRateLimiter, :clean_gitlab_redis_cache do
} }
} }
end end
let(:key) { rate_limits.keys[0] } let(:key) { rate_limits.keys[0] }
subject { described_class } subject { described_class }
......
...@@ -13,6 +13,7 @@ RSpec.describe Gitlab::Asciidoc::IncludeProcessor do ...@@ -13,6 +13,7 @@ RSpec.describe Gitlab::Asciidoc::IncludeProcessor do
ref: ref ref: ref
} }
end end
let(:ref) { project.repository.root_ref } let(:ref) { project.repository.root_ref }
let(:max_includes) { 10 } let(:max_includes) { 10 }
......
...@@ -473,6 +473,7 @@ module Gitlab ...@@ -473,6 +473,7 @@ module Gitlab
requested_path: requested_path requested_path: requested_path
} }
end end
let(:commit) { project.commit(ref) } let(:commit) { project.commit(ref) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:ref) { 'asciidoc' } let(:ref) { 'asciidoc' }
......
...@@ -12,6 +12,7 @@ RSpec.describe Gitlab::Auth::AuthFinders do ...@@ -12,6 +12,7 @@ RSpec.describe Gitlab::Auth::AuthFinders do
'rack.input' => '' 'rack.input' => ''
} }
end end
let(:request) { ActionDispatch::Request.new(env) } let(:request) { ActionDispatch::Request.new(env) }
def set_param(key, value) def set_param(key, value)
......
...@@ -14,9 +14,11 @@ RSpec.describe Gitlab::Auth::Ldap::User do ...@@ -14,9 +14,11 @@ RSpec.describe Gitlab::Auth::Ldap::User do
nickname: 'john' nickname: 'john'
} }
end end
let(:auth_hash) do let(:auth_hash) do
OmniAuth::AuthHash.new(uid: 'uid=John Smith,ou=People,dc=example,dc=com', provider: 'ldapmain', info: info) OmniAuth::AuthHash.new(uid: 'uid=John Smith,ou=People,dc=example,dc=com', provider: 'ldapmain', info: info)
end end
let(:ldap_user_upper_case) { described_class.new(auth_hash_upper_case) } let(:ldap_user_upper_case) { described_class.new(auth_hash_upper_case) }
let(:info_upper_case) do let(:info_upper_case) do
{ {
...@@ -25,6 +27,7 @@ RSpec.describe Gitlab::Auth::Ldap::User do ...@@ -25,6 +27,7 @@ RSpec.describe Gitlab::Auth::Ldap::User do
nickname: 'john' nickname: 'john'
} }
end end
let(:auth_hash_upper_case) do let(:auth_hash_upper_case) do
OmniAuth::AuthHash.new(uid: 'uid=John Smith,ou=People,dc=example,dc=com', provider: 'ldapmain', info: info_upper_case) OmniAuth::AuthHash.new(uid: 'uid=John Smith,ou=People,dc=example,dc=com', provider: 'ldapmain', info: info_upper_case)
end end
......
...@@ -17,6 +17,7 @@ RSpec.describe Gitlab::Auth::OAuth::AuthHash do ...@@ -17,6 +17,7 @@ RSpec.describe Gitlab::Auth::OAuth::AuthHash do
let(:uid_raw) do let(:uid_raw) do
+"CN=Onur K\xC3\xBC\xC3\xA7\xC3\xBCk,OU=Test,DC=example,DC=net" +"CN=Onur K\xC3\xBC\xC3\xA7\xC3\xBCk,OU=Test,DC=example,DC=net"
end end
let(:email_raw) { +"onur.k\xC3\xBC\xC3\xA7\xC3\xBCk_ABC-123@example.net" } let(:email_raw) { +"onur.k\xC3\xBC\xC3\xA7\xC3\xBCk_ABC-123@example.net" }
let(:nickname_raw) { +"ok\xC3\xBC\xC3\xA7\xC3\xBCk" } let(:nickname_raw) { +"ok\xC3\xBC\xC3\xA7\xC3\xBCk" }
let(:first_name_raw) { +'Onur' } let(:first_name_raw) { +'Onur' }
......
...@@ -22,6 +22,7 @@ RSpec.describe Gitlab::Auth::OAuth::User do ...@@ -22,6 +22,7 @@ RSpec.describe Gitlab::Auth::OAuth::User do
} }
} }
end end
let(:ldap_user) { Gitlab::Auth::Ldap::Person.new(Net::LDAP::Entry.new, 'ldapmain') } let(:ldap_user) { Gitlab::Auth::Ldap::Person.new(Net::LDAP::Entry.new, 'ldapmain') }
describe '#persisted?' do describe '#persisted?' do
......
...@@ -9,6 +9,7 @@ RSpec.describe Gitlab::Auth::RequestAuthenticator do ...@@ -9,6 +9,7 @@ RSpec.describe Gitlab::Auth::RequestAuthenticator do
'REQUEST_METHOD' => 'GET' 'REQUEST_METHOD' => 'GET'
} }
end end
let(:request) { ActionDispatch::Request.new(env) } let(:request) { ActionDispatch::Request.new(env) }
subject { described_class.new(request) } subject { described_class.new(request) }
......
...@@ -19,6 +19,7 @@ RSpec.describe Gitlab::Auth::Saml::User do ...@@ -19,6 +19,7 @@ RSpec.describe Gitlab::Auth::Saml::User do
email: 'john@mail.com' email: 'john@mail.com'
} }
end end
let(:ldap_user) { Gitlab::Auth::Ldap::Person.new(Net::LDAP::Entry.new, 'ldapmain') } let(:ldap_user) { Gitlab::Auth::Ldap::Person.new(Net::LDAP::Entry.new, 'ldapmain') }
describe '#save' do describe '#save' do
...@@ -194,6 +195,7 @@ RSpec.describe Gitlab::Auth::Saml::User do ...@@ -194,6 +195,7 @@ RSpec.describe Gitlab::Auth::Saml::User do
} }
} }
end end
let(:auth_hash) { OmniAuth::AuthHash.new(auth_hash_base_attributes) } let(:auth_hash) { OmniAuth::AuthHash.new(auth_hash_base_attributes) }
let(:uid_types) { %w(uid dn email) } let(:uid_types) { %w(uid dn email) }
......
...@@ -631,6 +631,7 @@ RSpec.describe Gitlab::Auth, :use_clean_rails_memory_store_caching do ...@@ -631,6 +631,7 @@ RSpec.describe Gitlab::Auth, :use_clean_rails_memory_store_caching do
password: password, password: password,
password_confirmation: password) password_confirmation: password)
end end
let(:username) { 'John' } # username isn't lowercase, test this let(:username) { 'John' } # username isn't lowercase, test this
let(:password) { 'my-secret' } let(:password) { 'my-secret' }
......
...@@ -264,6 +264,7 @@ RSpec.describe Gitlab::BackgroundMigration::BackfillSnippetRepositories, :migrat ...@@ -264,6 +264,7 @@ RSpec.describe Gitlab::BackgroundMigration::BackfillSnippetRepositories, :migrat
user_type: user_type, user_type: user_type,
confirmed_at: 1.day.ago) confirmed_at: 1.day.ago)
end end
let!(:invalid_snippet) { snippets.create(id: 4, type: 'PersonalSnippet', author_id: user.id, file_name: '.', content: content) } let!(:invalid_snippet) { snippets.create(id: 4, type: 'PersonalSnippet', author_id: user.id, file_name: '.', content: content) }
let!(:snippet) { snippets.create(id: 5, type: 'PersonalSnippet', author_id: other_user.id, file_name: file_name, content: content) } let!(:snippet) { snippets.create(id: 5, type: 'PersonalSnippet', author_id: other_user.id, file_name: file_name, content: content) }
let(:ids) { [4, 5] } let(:ids) { [4, 5] }
......
...@@ -264,6 +264,7 @@ RSpec.describe Gitlab::BackgroundMigration::LegacyUploadMover do ...@@ -264,6 +264,7 @@ RSpec.describe Gitlab::BackgroundMigration::LegacyUploadMover do
let(:remote_file) do let(:remote_file) do
{ key: "#{legacy_upload.path}" } { key: "#{legacy_upload.path}" }
end end
let(:connection) { ::Fog::Storage.new(FileUploader.object_store_credentials) } let(:connection) { ::Fog::Storage.new(FileUploader.object_store_credentials) }
let(:bucket) { connection.directories.create(key: 'uploads') } let(:bucket) { connection.directories.create(key: 'uploads') }
......
...@@ -286,9 +286,11 @@ RSpec.describe Gitlab::BackgroundMigration::MigrateIssueTrackersSensitiveData, s ...@@ -286,9 +286,11 @@ RSpec.describe Gitlab::BackgroundMigration::MigrateIssueTrackersSensitiveData, s
let!(:jira_service_invalid) do let!(:jira_service_invalid) do
services.create(id: 19, title: 'invalid - title', description: 'invalid - description', type: 'JiraService', properties: 'invalid data', category: 'issue_tracker') services.create(id: 19, title: 'invalid - title', description: 'invalid - description', type: 'JiraService', properties: 'invalid data', category: 'issue_tracker')
end end
let!(:jira_service_valid) do let!(:jira_service_valid) do
services.create(id: 20, type: 'JiraService', properties: jira_properties.to_json, category: 'issue_tracker') services.create(id: 20, type: 'JiraService', properties: jira_properties.to_json, category: 'issue_tracker')
end end
let!(:bugzilla_service_valid) do let!(:bugzilla_service_valid) do
services.create(id: 11, type: 'BugzillaService', title: nil, properties: tracker_properties.to_json, category: 'issue_tracker') services.create(id: 11, type: 'BugzillaService', title: nil, properties: tracker_properties.to_json, category: 'issue_tracker')
end end
......
...@@ -130,6 +130,7 @@ RSpec.describe Gitlab::BackgroundMigration do ...@@ -130,6 +130,7 @@ RSpec.describe Gitlab::BackgroundMigration do
let(:retry_queue) do let(:retry_queue) do
[double(args: ['Object', [3]], queue: described_class.queue, delete: true)] [double(args: ['Object', [3]], queue: described_class.queue, delete: true)]
end end
let(:dead_queue) do let(:dead_queue) do
[double(args: ['Object', [4]], queue: described_class.queue, delete: true)] [double(args: ['Object', [4]], queue: described_class.queue, delete: true)]
end end
......
...@@ -87,6 +87,7 @@ RSpec.describe Gitlab::BitbucketImport::Importer do ...@@ -87,6 +87,7 @@ RSpec.describe Gitlab::BitbucketImport::Importer do
values: sample_issues_statuses values: sample_issues_statuses
} }
end end
let(:counter) { double('counter', increment: true) } let(:counter) { double('counter', increment: true) }
subject { described_class.new(project) } subject { described_class.new(project) }
...@@ -109,6 +110,7 @@ RSpec.describe Gitlab::BitbucketImport::Importer do ...@@ -109,6 +110,7 @@ RSpec.describe Gitlab::BitbucketImport::Importer do
created_at: Time.now, created_at: Time.now,
updated_at: Time.now) updated_at: Time.now)
end end
let(:author_line) { "*Created by: someuser*\n\n" } let(:author_line) { "*Created by: someuser*\n\n" }
before do before do
......
...@@ -213,6 +213,7 @@ RSpec.describe Gitlab::Ci::Ansi2html do ...@@ -213,6 +213,7 @@ RSpec.describe Gitlab::Ci::Ansi2html do
" data-timestamp=\"#{section_start_time.to_i}\" data-section=\"#{class_name(section_name)}\"" \ " data-timestamp=\"#{section_start_time.to_i}\" data-section=\"#{class_name(section_name)}\"" \
' role="button"></div>' ' role="button"></div>'
end end
let(:section_end_html) do let(:section_end_html) do
"<div class=\"section-end\" data-section=\"#{class_name(section_name)}\"></div>" "<div class=\"section-end\" data-section=\"#{class_name(section_name)}\"></div>"
end end
......
...@@ -95,6 +95,7 @@ RSpec.describe Gitlab::Ci::Config::Entry::Service do ...@@ -95,6 +95,7 @@ RSpec.describe Gitlab::Ci::Config::Entry::Service do
let(:config) do let(:config) do
{ name: 'postgresql:9.5', alias: 'db', command: %w(cmd run), entrypoint: %w(/bin/sh run), ports: ports } { name: 'postgresql:9.5', alias: 'db', command: %w(cmd run), entrypoint: %w(/bin/sh run), ports: ports }
end end
let(:entry) { described_class.new(config, { with_image_ports: image_ports }) } let(:entry) { described_class.new(config, { with_image_ports: image_ports }) }
let(:image_ports) { false } let(:image_ports) { false }
......
...@@ -92,6 +92,7 @@ RSpec.describe Gitlab::Ci::Config::External::File::Local do ...@@ -92,6 +92,7 @@ RSpec.describe Gitlab::Ci::Config::External::File::Local do
- bundle install --jobs $(nproc) "${FLAGS[@]}" - bundle install --jobs $(nproc) "${FLAGS[@]}"
HEREDOC HEREDOC
end end
let(:location) { '/lib/gitlab/ci/templates/existent-file.yml' } let(:location) { '/lib/gitlab/ci/templates/existent-file.yml' }
before do before do
......
...@@ -128,6 +128,7 @@ RSpec.describe Gitlab::Ci::Config::External::Processor do ...@@ -128,6 +128,7 @@ RSpec.describe Gitlab::Ci::Config::External::Processor do
remote_file remote_file
] ]
end end
let(:values) do let(:values) do
{ {
include: external_files, include: external_files,
......
...@@ -68,6 +68,7 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Validate::Repository do ...@@ -68,6 +68,7 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Validate::Repository do
proj.repository.add_tag(user, 'master', 'master') proj.repository.add_tag(user, 'master', 'master')
end end
end end
let(:command) do let(:command) do
Gitlab::Ci::Pipeline::Chain::Command.new( Gitlab::Ci::Pipeline::Chain::Command.new(
project: project, current_user: user, origin_ref: 'master') project: project, current_user: user, origin_ref: 'master')
......
...@@ -21,6 +21,7 @@ RSpec.describe Gitlab::Ci::Reports::AccessibilityReportsComparer do ...@@ -21,6 +21,7 @@ RSpec.describe Gitlab::Ci::Reports::AccessibilityReportsComparer do
} }
] ]
end end
let(:different_error) do let(:different_error) do
[ [
{ {
......
...@@ -942,6 +942,7 @@ module Gitlab ...@@ -942,6 +942,7 @@ module Gitlab
let(:variables) do let(:variables) do
{ 'VAR1' => 'value1', 'VAR2' => 'value2' } { 'VAR1' => 'value1', 'VAR2' => 'value2' }
end end
let(:config) do let(:config) do
{ {
variables: variables, variables: variables,
...@@ -962,9 +963,11 @@ module Gitlab ...@@ -962,9 +963,11 @@ module Gitlab
let(:global_variables) do let(:global_variables) do
{ 'VAR1' => 'global1', 'VAR3' => 'global3', 'VAR4' => 'global4' } { 'VAR1' => 'global1', 'VAR3' => 'global3', 'VAR4' => 'global4' }
end end
let(:job_variables) do let(:job_variables) do
{ 'VAR1' => 'value1', 'VAR2' => 'value2' } { 'VAR1' => 'value1', 'VAR2' => 'value2' }
end end
let(:config) do let(:config) do
{ {
before_script: ['pwd'], before_script: ['pwd'],
...@@ -2075,6 +2078,7 @@ module Gitlab ...@@ -2075,6 +2078,7 @@ module Gitlab
{ job: "build2" } { job: "build2" }
] ]
end end
let(:dependencies) { %w(build3) } let(:dependencies) { %w(build3) }
it { expect { subject }.to raise_error(Gitlab::Ci::YamlProcessor::ValidationError, 'jobs:test1 dependencies the build3 should be part of needs') } it { expect { subject }.to raise_error(Gitlab::Ci::YamlProcessor::ValidationError, 'jobs:test1 dependencies the build3 should be part of needs') }
......
...@@ -11,6 +11,7 @@ RSpec.describe Gitlab::Cleanup::RemoteUploads do ...@@ -11,6 +11,7 @@ RSpec.describe Gitlab::Cleanup::RemoteUploads do
create(:upload, path: 'dir/file2', store: ObjectStorage::Store::LOCAL) create(:upload, path: 'dir/file2', store: ObjectStorage::Store::LOCAL)
] ]
end end
let(:remote_files) do let(:remote_files) do
[ [
double(key: 'dir/file1'), double(key: 'dir/file1'),
......
...@@ -8,6 +8,7 @@ RSpec.describe Gitlab::CrossProjectAccess::ClassMethods do ...@@ -8,6 +8,7 @@ RSpec.describe Gitlab::CrossProjectAccess::ClassMethods do
extend Gitlab::CrossProjectAccess::ClassMethods extend Gitlab::CrossProjectAccess::ClassMethods
end end
end end
let(:dummy_proc) { lambda { false } } let(:dummy_proc) { lambda { false } }
describe '#requires_cross_project_access' do describe '#requires_cross_project_access' do
......
...@@ -16,6 +16,7 @@ RSpec.describe Gitlab::Danger::CommitLinter do ...@@ -16,6 +16,7 @@ RSpec.describe Gitlab::Danger::CommitLinter do
let(:commit_class) do let(:commit_class) do
Struct.new(:message, :sha, :diff_parent) Struct.new(:message, :sha, :diff_parent)
end end
let(:commit_message) { 'A commit message' } let(:commit_message) { 'A commit message' }
let(:commit_sha) { 'abcd1234' } let(:commit_sha) { 'abcd1234' }
let(:commit) { commit_class.new(commit_message, commit_sha, diff_parent) } let(:commit) { commit_class.new(commit_message, commit_sha, diff_parent) }
......
...@@ -22,6 +22,7 @@ RSpec.describe Gitlab::Danger::Roulette do ...@@ -22,6 +22,7 @@ RSpec.describe Gitlab::Danger::Roulette do
'tz_offset_hours' => backend_tz_offset_hours 'tz_offset_hours' => backend_tz_offset_hours
) )
end end
let(:frontend_reviewer) do let(:frontend_reviewer) do
Gitlab::Danger::Teammate.new( Gitlab::Danger::Teammate.new(
'username' => 'frontend-reviewer', 'username' => 'frontend-reviewer',
...@@ -32,6 +33,7 @@ RSpec.describe Gitlab::Danger::Roulette do ...@@ -32,6 +33,7 @@ RSpec.describe Gitlab::Danger::Roulette do
'tz_offset_hours' => 2.0 'tz_offset_hours' => 2.0
) )
end end
let(:frontend_maintainer) do let(:frontend_maintainer) do
Gitlab::Danger::Teammate.new( Gitlab::Danger::Teammate.new(
'username' => 'frontend-maintainer', 'username' => 'frontend-maintainer',
...@@ -42,6 +44,7 @@ RSpec.describe Gitlab::Danger::Roulette do ...@@ -42,6 +44,7 @@ RSpec.describe Gitlab::Danger::Roulette do
'tz_offset_hours' => 2.0 'tz_offset_hours' => 2.0
) )
end end
let(:software_engineer_in_test) do let(:software_engineer_in_test) do
Gitlab::Danger::Teammate.new( Gitlab::Danger::Teammate.new(
'username' => 'software-engineer-in-test', 'username' => 'software-engineer-in-test',
...@@ -52,6 +55,7 @@ RSpec.describe Gitlab::Danger::Roulette do ...@@ -52,6 +55,7 @@ RSpec.describe Gitlab::Danger::Roulette do
'tz_offset_hours' => 2.0 'tz_offset_hours' => 2.0
) )
end end
let(:engineering_productivity_reviewer) do let(:engineering_productivity_reviewer) do
Gitlab::Danger::Teammate.new( Gitlab::Danger::Teammate.new(
'username' => 'eng-prod-reviewer', 'username' => 'eng-prod-reviewer',
...@@ -296,18 +300,21 @@ RSpec.describe Gitlab::Danger::Roulette do ...@@ -296,18 +300,21 @@ RSpec.describe Gitlab::Danger::Roulette do
'tz_offset_hours' => person_tz_offset_hours 'tz_offset_hours' => person_tz_offset_hours
) )
end end
let(:person2) do let(:person2) do
Gitlab::Danger::Teammate.new( Gitlab::Danger::Teammate.new(
'username' => 'user2', 'username' => 'user2',
'available' => true, 'available' => true,
'tz_offset_hours' => person_tz_offset_hours) 'tz_offset_hours' => person_tz_offset_hours)
end end
let(:author) do let(:author) do
Gitlab::Danger::Teammate.new( Gitlab::Danger::Teammate.new(
'username' => 'johndoe', 'username' => 'johndoe',
'available' => true, 'available' => true,
'tz_offset_hours' => 0.0) 'tz_offset_hours' => 0.0)
end end
let(:unavailable) do let(:unavailable) do
Gitlab::Danger::Teammate.new( Gitlab::Danger::Teammate.new(
'username' => 'janedoe', 'username' => 'janedoe',
......
...@@ -20,6 +20,7 @@ RSpec.describe Gitlab::Danger::Teammate do ...@@ -20,6 +20,7 @@ RSpec.describe Gitlab::Danger::Teammate do
'tz_offset_hours' => tz_offset_hours 'tz_offset_hours' => tz_offset_hours
} }
end end
let(:capabilities) { ['reviewer backend'] } let(:capabilities) { ['reviewer backend'] }
let(:projects) { { project => capabilities } } let(:projects) { { project => capabilities } }
let(:role) { 'Engineer, Manage' } let(:role) { 'Engineer, Manage' }
......
...@@ -23,6 +23,7 @@ RSpec.describe Gitlab::Database::Count::TablesampleCountStrategy do ...@@ -23,6 +23,7 @@ RSpec.describe Gitlab::Database::Count::TablesampleCountStrategy do
Namespace => threshold + 1 Namespace => threshold + 1
} }
end end
let(:threshold) { Gitlab::Database::Count::TablesampleCountStrategy::EXACT_COUNT_THRESHOLD } let(:threshold) { Gitlab::Database::Count::TablesampleCountStrategy::EXACT_COUNT_THRESHOLD }
before do before do
......
...@@ -32,6 +32,7 @@ RSpec.describe Gitlab::Database::CustomStructure do ...@@ -32,6 +32,7 @@ RSpec.describe Gitlab::Database::CustomStructure do
Gitlab::Database::PartitioningMigrationHelpers::PartitionedForeignKey.create( Gitlab::Database::PartitioningMigrationHelpers::PartitionedForeignKey.create(
cascade_delete: true, from_table: 'issues', from_column: 'project_id', to_table: 'projects', to_column: 'id') cascade_delete: true, from_table: 'issues', from_column: 'project_id', to_table: 'projects', to_column: 'id')
end end
let!(:second_fk) do let!(:second_fk) do
Gitlab::Database::PartitioningMigrationHelpers::PartitionedForeignKey.create( Gitlab::Database::PartitioningMigrationHelpers::PartitionedForeignKey.create(
cascade_delete: false, from_table: 'issues', from_column: 'moved_to_id', to_table: 'issues', to_column: 'id') cascade_delete: false, from_table: 'issues', from_column: 'moved_to_id', to_table: 'issues', to_column: 'id')
......
...@@ -8,6 +8,7 @@ RSpec.describe Gitlab::Database::PartitioningMigrationHelpers::ForeignKeyHelpers ...@@ -8,6 +8,7 @@ RSpec.describe Gitlab::Database::PartitioningMigrationHelpers::ForeignKeyHelpers
let(:model) do let(:model) do
ActiveRecord::Migration.new.extend(described_class) ActiveRecord::Migration.new.extend(described_class)
end end
let_it_be(:connection) { ActiveRecord::Base.connection } let_it_be(:connection) { ActiveRecord::Base.connection }
let(:referenced_table) { :issues } let(:referenced_table) { :issues }
let(:function_name) { '_test_partitioned_foreign_keys_function' } let(:function_name) { '_test_partitioned_foreign_keys_function' }
......
...@@ -351,6 +351,7 @@ RSpec.describe Gitlab::Database::PartitioningMigrationHelpers::TableManagementHe ...@@ -351,6 +351,7 @@ RSpec.describe Gitlab::Database::PartitioningMigrationHelpers::TableManagementHe
let(:expected_tables) do let(:expected_tables) do
%w[000000 201912 202001 202002].map { |suffix| "#{Gitlab::Database::DYNAMIC_PARTITIONS_SCHEMA}.#{partitioned_table}_#{suffix}" }.unshift(partitioned_table) %w[000000 201912 202001 202002].map { |suffix| "#{Gitlab::Database::DYNAMIC_PARTITIONS_SCHEMA}.#{partitioned_table}_#{suffix}" }.unshift(partitioned_table)
end end
let(:migration_class) { 'Gitlab::Database::PartitioningMigrationHelpers::BackfillPartitionedTable' } let(:migration_class) { 'Gitlab::Database::PartitioningMigrationHelpers::BackfillPartitionedTable' }
context 'when the table is not allowed' do context 'when the table is not allowed' do
......
...@@ -13,6 +13,7 @@ RSpec.describe Gitlab::Database::PostgresqlAdapter::ForceDisconnectableMixin do ...@@ -13,6 +13,7 @@ RSpec.describe Gitlab::Database::PostgresqlAdapter::ForceDisconnectableMixin do
end end
end end
end end
let(:config) { Rails.application.config_for(:database).merge(pool: 1) } let(:config) { Rails.application.config_for(:database).merge(pool: 1) }
let(:pool) { model.establish_connection(config) } let(:pool) { model.establish_connection(config) }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment