Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-29 15:09:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-29 15:09:08 +0300
commit7cc6872401eb487ed20dbb9d455f8bb9c97d9e39 (patch)
tree63f6ed5d4e6c5cec31c43363626d9f5b178eddf8 /spec/requests/self_monitoring_project_spec.rb
parent46b10c0fc884400941c17e2777b242ac54d111e5 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/self_monitoring_project_spec.rb')
-rw-r--r--spec/requests/self_monitoring_project_spec.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/spec/requests/self_monitoring_project_spec.rb b/spec/requests/self_monitoring_project_spec.rb
index 1da0be882d0..5e46645e7a0 100644
--- a/spec/requests/self_monitoring_project_spec.rb
+++ b/spec/requests/self_monitoring_project_spec.rb
@@ -68,6 +68,8 @@ describe 'Self-Monitoring project requests' do
let(:job_id) { nil }
it 'returns bad_request' do
+ create(:application_setting)
+
subject
aggregate_failures do
@@ -81,11 +83,10 @@ describe 'Self-Monitoring project requests' do
end
context 'when self-monitoring project exists' do
- let(:project) { build(:project) }
+ let(:project) { create(:project) }
before do
- stub_application_setting(self_monitoring_project_id: 1)
- stub_application_setting(self_monitoring_project: project)
+ create(:application_setting, self_monitoring_project_id: project.id)
end
it 'does not need job_id' do
@@ -94,7 +95,7 @@ describe 'Self-Monitoring project requests' do
aggregate_failures do
expect(response).to have_gitlab_http_status(:success)
expect(json_response).to eq(
- 'project_id' => 1,
+ 'project_id' => project.id,
'project_full_path' => project.full_path
)
end
@@ -106,7 +107,7 @@ describe 'Self-Monitoring project requests' do
aggregate_failures do
expect(response).to have_gitlab_http_status(:success)
expect(json_response).to eq(
- 'project_id' => 1,
+ 'project_id' => project.id,
'project_full_path' => project.full_path
)
end
@@ -179,7 +180,7 @@ describe 'Self-Monitoring project requests' do
context 'when self-monitoring project exists and job does not exist' do
before do
- stub_application_setting(self_monitoring_project_id: 1)
+ create(:application_setting, self_monitoring_project_id: create(:project).id)
end
it 'returns bad_request' do
@@ -196,6 +197,10 @@ describe 'Self-Monitoring project requests' do
end
context 'when self-monitoring project does not exist' do
+ before do
+ create(:application_setting)
+ end
+
it 'does not need job_id' do
get status_delete_self_monitoring_project_admin_application_settings_path