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-04-01 18:07:45 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-01 18:07:45 +0300
commit1219a9dce91f4edbc135dfc08299b4122b4825a8 (patch)
treee7d12a55d75a2d56e60d9527bef3724e3578866d /spec/finders
parent1a0d6dbdc2ac3047f4953a359ef27ba6e26074ae (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/finders')
-rw-r--r--spec/finders/concerns/finder_with_cross_project_access_spec.rb2
-rw-r--r--spec/finders/issues_finder_spec.rb6
-rw-r--r--spec/finders/sentry_issue_finder_spec.rb2
-rw-r--r--spec/finders/snippets_finder_spec.rb4
4 files changed, 8 insertions, 6 deletions
diff --git a/spec/finders/concerns/finder_with_cross_project_access_spec.rb b/spec/finders/concerns/finder_with_cross_project_access_spec.rb
index f3365309b05..d11d4da25a8 100644
--- a/spec/finders/concerns/finder_with_cross_project_access_spec.rb
+++ b/spec/finders/concerns/finder_with_cross_project_access_spec.rb
@@ -97,7 +97,7 @@ describe FinderWithCrossProjectAccess do
end
it 're-enables the check after the find failed' do
- finder.find_by!(id: 9999) rescue ActiveRecord::RecordNotFound
+ finder.find_by!(id: non_existing_record_id) rescue ActiveRecord::RecordNotFound
expect(finder.instance_variable_get(:@should_skip_cross_project_check))
.to eq(false)
diff --git a/spec/finders/issues_finder_spec.rb b/spec/finders/issues_finder_spec.rb
index b6bedab724a..baf40861a6e 100644
--- a/spec/finders/issues_finder_spec.rb
+++ b/spec/finders/issues_finder_spec.rb
@@ -774,14 +774,16 @@ describe IssuesFinder do
end
describe '#row_count', :request_store do
+ let_it_be(:admin) { create(:admin) }
+
it 'returns the number of rows for the default state' do
- finder = described_class.new(user)
+ finder = described_class.new(admin)
expect(finder.row_count).to eq(4)
end
it 'returns the number of rows for a given state' do
- finder = described_class.new(user, state: 'closed')
+ finder = described_class.new(admin, state: 'closed')
expect(finder.row_count).to be_zero
end
diff --git a/spec/finders/sentry_issue_finder_spec.rb b/spec/finders/sentry_issue_finder_spec.rb
index 5535eb8c214..520f690a134 100644
--- a/spec/finders/sentry_issue_finder_spec.rb
+++ b/spec/finders/sentry_issue_finder_spec.rb
@@ -27,7 +27,7 @@ describe SentryIssueFinder do
it { is_expected.to eq(sentry_issue) }
context 'when identifier is incorrect' do
- let(:identifier) { 1234 }
+ let(:identifier) { non_existing_record_id }
it { is_expected.to be_nil }
end
diff --git a/spec/finders/snippets_finder_spec.rb b/spec/finders/snippets_finder_spec.rb
index 69e03c4c473..fdcc73f6e92 100644
--- a/spec/finders/snippets_finder_spec.rb
+++ b/spec/finders/snippets_finder_spec.rb
@@ -114,7 +114,7 @@ describe SnippetsFinder do
context 'when author is not valid' do
it 'returns quickly' do
- finder = described_class.new(admin, author: 1234)
+ finder = described_class.new(admin, author: non_existing_record_id)
expect(finder).not_to receive(:init_collection)
expect(Snippet).to receive(:none).and_call_original
@@ -208,7 +208,7 @@ describe SnippetsFinder do
context 'when project is not valid' do
it 'returns quickly' do
- finder = described_class.new(admin, project: 1234)
+ finder = described_class.new(admin, project: non_existing_record_id)
expect(finder).not_to receive(:init_collection)
expect(Snippet).to receive(:none).and_call_original