diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-17 18:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-17 18:08:36 +0300 |
commit | c61d90dbfa0a7cb58b758ed07a9d0b5406beb61e (patch) | |
tree | 5c29d476a605417c370997caf3dabe8e8270b8be /spec/models | |
parent | a89912871cb169249d3ddc2ed59326d47ecdae82 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/concerns/route_model_query_spec.rb | 28 | ||||
-rw-r--r-- | spec/models/snippet_spec.rb | 26 |
2 files changed, 0 insertions, 54 deletions
diff --git a/spec/models/concerns/route_model_query_spec.rb b/spec/models/concerns/route_model_query_spec.rb deleted file mode 100644 index ac58c8d44fa..00000000000 --- a/spec/models/concerns/route_model_query_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Route, 'RouteModelQuery', :aggregate_failures do - let_it_be(:group1) { create(:group, path: 'Group1') } - let_it_be(:group2) { create(:group, path: 'Group2') } - let_it_be(:project1) { create(:project, path: 'Project1', group: group1) } - let_it_be(:project2) { create(:project, path: 'Project2', group: group2) } - - describe '.find_source_of_path' do - it 'finds exact match' do - expect(described_class.find_source_of_path('Group1')).to eq(group1) - expect(described_class.find_source_of_path('Group2/Project2')).to eq(project2) - - expect(described_class.find_source_of_path('GROUP1')).to be_nil - expect(described_class.find_source_of_path('GROUP2/PROJECT2')).to be_nil - end - - it 'finds case insensitive match' do - expect(described_class.find_source_of_path('Group1', case_sensitive: false)).to eq(group1) - expect(described_class.find_source_of_path('Group2/Project2', case_sensitive: false)).to eq(project2) - - expect(described_class.find_source_of_path('GROUP1', case_sensitive: false)).to eq(group1) - expect(described_class.find_source_of_path('GROUP2/PROJECT2', case_sensitive: false)).to eq(project2) - end - end -end diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb index 22e78c49ce5..4d6586c1df4 100644 --- a/spec/models/snippet_spec.rb +++ b/spec/models/snippet_spec.rb @@ -206,32 +206,6 @@ describe Snippet do end end - describe '.find_by_id_and_project' do - let_it_be(:project) { create(:project) } - let_it_be(:project_snippet) { create(:project_snippet, project: project) } - let_it_be(:personal_snippet) { create(:personal_snippet) } - - context 'when project is provided' do - it 'returns ProjectSnippet' do - expect(described_class.find_by_id_and_project(id: project_snippet.id, project: project)).to eq(project_snippet) - end - end - - context 'when project is nil' do - it 'returns PersonalSnippet' do - expect(described_class.find_by_id_and_project(id: personal_snippet.id, project: nil)).to eq(personal_snippet) - end - end - - context 'when project variable is not a Project' do - let(:namespace) { build_stubbed(:namespace, id: project.id) } - - it 'returns nil' do - expect(described_class.find_by_id_and_project(id: project_snippet.id, project: namespace)).to be_nil - end - end - end - describe '.with_optional_visibility' do context 'when a visibility level is provided' do it 'returns snippets with the given visibility' do |