diff options
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r-- | spec/models/project_spec.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 44be4985439..ceb6382eb6c 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -108,6 +108,8 @@ describe Project do it { is_expected.to have_many(:external_pull_requests) } it { is_expected.to have_many(:sourced_pipelines) } it { is_expected.to have_many(:source_pipelines) } + it { is_expected.to have_many(:prometheus_alert_events) } + it { is_expected.to have_many(:self_managed_prometheus_alert_events) } it_behaves_like 'model with repository' do let_it_be(:container) { create(:project, :repository, path: 'somewhere') } @@ -1757,7 +1759,7 @@ describe Project do expect(described_class.search(project.path.upcase)).to eq([project]) end - context 'by full path' do + context 'when include_namespace is true' do let_it_be(:group) { create(:group) } let_it_be(:project) { create(:project, group: group) } @@ -1767,11 +1769,11 @@ describe Project do end it 'returns projects that match the group path' do - expect(described_class.search(group.path)).to eq([project]) + expect(described_class.search(group.path, include_namespace: true)).to eq([project]) end it 'returns projects that match the full path' do - expect(described_class.search(project.full_path)).to eq([project]) + expect(described_class.search(project.full_path, include_namespace: true)).to eq([project]) end end @@ -1781,11 +1783,11 @@ describe Project do end it 'returns no results when searching by group path' do - expect(described_class.search(group.path)).to be_empty + expect(described_class.search(group.path, include_namespace: true)).to be_empty end it 'returns no results when searching by full path' do - expect(described_class.search(project.full_path)).to be_empty + expect(described_class.search(project.full_path, include_namespace: true)).to be_empty end end end |