Commit 2a36ac0c authored by charlie ablett's avatar charlie ablett

Merge branch '350603-cablett-project-owner-specs-4' into 'master'

Replace owner with first_owner in feature specs

See merge request gitlab-org/gitlab!78757
parents 53fcc07d 20efe222
......@@ -17,7 +17,7 @@ RSpec.describe 'Breadcrumbs schema markup', :aggregate_failures do
expect(item_list.size).to eq 2
expect(item_list[0]['name']).to eq project.namespace.name
expect(item_list[0]['item']).to eq user_url(project.owner)
expect(item_list[0]['item']).to eq user_url(project.first_owner)
expect(item_list[1]['name']).to eq project.name
expect(item_list[1]['item']).to eq project_url(project)
......@@ -59,7 +59,7 @@ RSpec.describe 'Breadcrumbs schema markup', :aggregate_failures do
expect(item_list.size).to eq 3
expect(item_list[0]['name']).to eq project.namespace.name
expect(item_list[0]['item']).to eq user_url(project.owner)
expect(item_list[0]['item']).to eq user_url(project.first_owner)
expect(item_list[1]['name']).to eq project.name
expect(item_list[1]['item']).to eq project_url(project)
......@@ -75,7 +75,7 @@ RSpec.describe 'Breadcrumbs schema markup', :aggregate_failures do
expect(item_list.size).to eq 4
expect(item_list[0]['name']).to eq project.namespace.name
expect(item_list[0]['item']).to eq user_url(project.owner)
expect(item_list[0]['item']).to eq user_url(project.first_owner)
expect(item_list[1]['name']).to eq project.name
expect(item_list[1]['item']).to eq project_url(project)
......
......@@ -6,7 +6,7 @@ RSpec.describe 'Contextual sidebar', :js do
context 'when context is a project' do
let_it_be(:project) { create(:project) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in(user)
......
......@@ -7,11 +7,11 @@ RSpec.describe 'Dashboard snippets' do
context 'when the project has snippets' do
let(:project) { create(:project, :public, creator: user) }
let!(:snippets) { create_list(:project_snippet, 2, :public, author: project.owner, project: project) }
let!(:snippets) { create_list(:project_snippet, 2, :public, author: project.first_owner, project: project) }
before do
allow(Snippet).to receive(:default_per_page).and_return(1)
sign_in(project.owner)
sign_in(project.first_owner)
visit dashboard_snippets_path
end
......@@ -27,7 +27,7 @@ RSpec.describe 'Dashboard snippets' do
let(:project) { create(:project, :public, creator: user) }
before do
sign_in(project.owner)
sign_in(project.first_owner)
visit dashboard_snippets_path
end
......
......@@ -22,7 +22,7 @@ RSpec.describe 'When a user filters Sentry errors by status', :js, :use_clean_ra
end
it 'displays the results' do
sign_in(project.owner)
sign_in(project.first_owner)
visit project_error_tracking_index_path(project)
page.within(find('.gl-table')) do
results = page.all('.table-row')
......
......@@ -22,7 +22,7 @@ RSpec.describe 'When a user searches for Sentry errors', :js, :use_clean_rails_m
end
it 'displays the results' do
sign_in(project.owner)
sign_in(project.first_owner)
visit project_error_tracking_index_path(project)
page.within(find('.gl-table')) do
......
......@@ -7,7 +7,7 @@ RSpec.describe 'View error details page', :js, :use_clean_rails_memory_store_cac
context 'with current user as project owner' do
before do
sign_in(project.owner)
sign_in(project.first_owner)
visit details_project_error_tracking_index_path(project, issue_id: issue_id)
end
......
......@@ -18,7 +18,7 @@ RSpec.describe 'View error index page', :js, :use_clean_rails_memory_store_cachi
context 'with current user as project owner' do
before do
sign_in(project.owner)
sign_in(project.first_owner)
visit project_error_tracking_index_path(project)
end
......@@ -43,7 +43,7 @@ RSpec.describe 'View error index page', :js, :use_clean_rails_memory_store_cachi
context 'with error tracking settings disabled' do
before do
project_error_tracking_settings.update!(enabled: false)
sign_in(project.owner)
sign_in(project.first_owner)
visit project_error_tracking_index_path(project)
end
......
......@@ -6,7 +6,7 @@ RSpec.describe 'Upload an attachment', :api, :js do
include_context 'file upload requests helpers'
let_it_be(:project) { create(:project) }
let_it_be(:user) { project.owner }
let_it_be(:user) { project.first_owner }
let_it_be(:personal_access_token) { create(:personal_access_token, user: user) }
let(:api_path) { "/projects/#{project_id}/uploads" }
......
......@@ -6,7 +6,7 @@ RSpec.describe 'Upload a git lfs object', :js do
include_context 'file upload requests helpers'
let_it_be(:project) { create(:project) }
let_it_be(:user) { project.owner }
let_it_be(:user) { project.first_owner }
let_it_be(:personal_access_token) { create(:personal_access_token, user: user) }
let(:file) { fixture_file_upload('spec/fixtures/banana_sample.gif') }
......
......@@ -6,7 +6,7 @@ RSpec.describe 'Upload a maven package', :api, :js do
include_context 'file upload requests helpers'
let_it_be(:project) { create(:project) }
let_it_be(:user) { project.owner }
let_it_be(:user) { project.first_owner }
let_it_be(:personal_access_token) { create(:personal_access_token, user: user) }
let(:project_id) { project.id }
......
......@@ -6,7 +6,7 @@ RSpec.describe 'Upload a nuget package', :api, :js do
include_context 'file upload requests helpers'
let_it_be(:project) { create(:project) }
let_it_be(:user) { project.owner }
let_it_be(:user) { project.first_owner }
let_it_be(:personal_access_token) { create(:personal_access_token, user: user) }
let(:api_path) { "/projects/#{project.id}/packages/nuget/" }
......
......@@ -6,7 +6,7 @@ RSpec.describe 'Upload a RubyGems package', :api, :js do
include_context 'file upload requests helpers'
let_it_be(:project) { create(:project) }
let_it_be(:user) { project.owner }
let_it_be(:user) { project.first_owner }
let_it_be(:personal_access_token) { create(:personal_access_token, user: user) }
let(:api_path) { "/projects/#{project_id}/packages/rubygems/api/v1/gems" }
......
......@@ -6,7 +6,7 @@ RSpec.describe 'IDE user commits changes', :js do
include WebIdeSpecHelpers
let(:project) { create(:project, :public, :repository) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in(user)
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe 'IDE merge request', :js do
let(:merge_request) { create(:merge_request, :simple, source_project: project) }
let(:project) { create(:project, :public, :repository) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in(user)
......
......@@ -5,11 +5,11 @@ require 'spec_helper'
RSpec.describe "Internal references", :js do
include Spec::Support::Helpers::Features::NotesHelpers
let(:private_project_user) { private_project.owner }
let(:private_project_user) { private_project.first_owner }
let(:private_project) { create(:project, :private, :repository) }
let(:private_project_issue) { create(:issue, project: private_project) }
let(:private_project_merge_request) { create(:merge_request, source_project: private_project) }
let(:public_project_user) { public_project.owner }
let(:public_project_user) { public_project.first_owner }
let(:public_project) { create(:project, :public, :repository) }
let(:public_project_issue) { create(:issue, project: public_project) }
let(:public_project_merge_request) { create(:merge_request, source_project: public_project) }
......
......@@ -8,7 +8,7 @@ RSpec.describe 'Issues shortcut', :js do
let(:project) { create(:project) }
before do
sign_in(project.owner)
sign_in(project.first_owner)
visit project_path(project)
end
......@@ -23,7 +23,7 @@ RSpec.describe 'Issues shortcut', :js do
let(:project) { create(:project, :issues_disabled) }
before do
sign_in(project.owner)
sign_in(project.first_owner)
visit project_path(project)
end
......
......@@ -663,7 +663,7 @@ RSpec.describe 'Copy as GFM', :js do
let(:project) { create(:project, :repository) }
before do
sign_in(project.owner)
sign_in(project.first_owner)
end
context 'from a diff' do
......
......@@ -24,7 +24,7 @@ RSpec.describe 'Merge request > User edits assignees sidebar', :js do
before do
stub_const('Autocomplete::UsersFinder::LIMIT', users_find_limit)
sign_in(project.owner)
sign_in(project.first_owner)
merge_request.assignees << assignee
......
......@@ -10,7 +10,7 @@ RSpec.describe 'Batch diffs', :js do
let(:merge_request) { create(:merge_request, source_project: project, source_branch: 'master', target_branch: 'empty-branch') }
before do
sign_in(project.owner)
sign_in(project.first_owner)
visit diffs_project_merge_request_path(merge_request.project, merge_request)
wait_for_requests
......
......@@ -3,7 +3,7 @@
require "spec_helper"
RSpec.describe "User merges a merge request", :js do
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in(user)
......
......@@ -4,7 +4,7 @@ require "spec_helper"
RSpec.describe "User rebases a merge request", :js do
let(:merge_request) { create(:merge_request, :simple, source_project: project) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in(user)
......
......@@ -6,7 +6,7 @@ RSpec.describe 'Merge request > image review', :js do
include MergeRequestDiffHelpers
include RepoHelpers
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request_with_diffs, :with_image_diffs, source_project: project, author: user) }
......
......@@ -82,7 +82,7 @@ RSpec.describe 'Merge request > User sees diff', :js do
end
context 'when file contains html' do
let(:current_user) { project.owner }
let(:current_user) { project.first_owner }
let(:branch_name) {"test_branch"}
it 'escapes any HTML special characters in the diff chunk header' do
......@@ -123,7 +123,7 @@ RSpec.describe 'Merge request > User sees diff', :js do
context 'when file is stored in LFS' do
let(:merge_request) { create(:merge_request, source_project: project) }
let(:current_user) { project.owner }
let(:current_user) { project.first_owner }
context 'when LFS is enabled on the project' do
before do
......
......@@ -11,7 +11,7 @@ RSpec.describe 'User views merged merge request from deleted fork' do
let(:project) { create(:project, :repository) }
let(:source_project) { fork_project(project, nil, repository: true) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let!(:merge_request) { create(:merge_request, :merged, source_project: source_project, target_project: project) }
before do
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe 'Project active tab' do
let_it_be(:project) { create(:project, :repository) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in(user)
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe 'Project Activity RSS' do
let(:project) { create(:project, :public) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:path) { activity_project_path(project) }
before do
......@@ -13,7 +13,7 @@ RSpec.describe 'Project Activity RSS' do
context 'when signed in' do
before do
sign_in(project.owner)
sign_in(project.first_owner)
visit path
end
......
......@@ -174,7 +174,7 @@ RSpec.describe 'File blob', :js do
it 'displays no highlighted number of different ref' do
Files::UpdateService.new(
project,
project.owner,
project.first_owner,
commit_message: 'Update',
start_branch: 'feature',
branch_name: 'feature',
......
......@@ -6,7 +6,7 @@ RSpec.describe 'User follows pipeline suggest nudge spec when feature is enabled
include CookieHelper
let(:project) { create(:project, :empty_repo) }
let(:user) { project.owner }
let(:user) { project.first_owner }
describe 'viewing the new blob page' do
before do
......
......@@ -4,7 +4,7 @@ require "spec_helper"
RSpec.describe "User views branches", :js do
let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { project.owner }
let_it_be(:user) { project.first_owner }
before do
sign_in(user)
......
......@@ -21,7 +21,7 @@ RSpec.describe 'Environment > Pod Logs', :js, :kubeclient do
stub_kubeclient_ingresses(environment.deployment_namespace)
stub_kubeclient_nodes_and_nodes_metrics(cluster.platform.api_url)
sign_in(project.owner)
sign_in(project.first_owner)
end
it "shows environments in dropdown" do
......
......@@ -7,7 +7,7 @@ RSpec.describe 'Projects > Files > User wants to add a Dockerfile file', :js do
before do
project = create(:project, :repository)
sign_in project.owner
sign_in project.first_owner
visit project_new_blob_path(project, 'master', file_name: 'Dockerfile')
end
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe 'Projects > Files > User uses soft wrap while editing file', :js do
before do
project = create(:project, :repository)
user = project.owner
user = project.first_owner
sign_in user
visit project_new_blob_path(project, 'master', file_name: 'test_file-name')
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe 'Projects > Files > User wants to edit a file' do
let(:project) { create(:project, :repository) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:commit_params) do
{
start_branch: project.default_branch,
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe 'Projects > Files > User views files page' do
let(:project) { create(:forked_project_with_submodules) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in user
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe 'Projects > Files > Find file keyboard shortcuts', :js do
let(:project) { create(:project, :repository) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in user
......
......@@ -7,7 +7,7 @@ RSpec.describe 'Projects > Files > User wants to add a .gitignore file', :js do
before do
project = create(:project, :repository)
sign_in project.owner
sign_in project.first_owner
visit project_new_blob_path(project, 'master', file_name: '.gitignore')
end
......
......@@ -11,7 +11,7 @@ RSpec.describe 'Projects > Files > User wants to add a .gitlab-ci.yml file', :js
let_it_be(:project) { create(:project, :repository) }
before do
sign_in project.owner
sign_in project.first_owner
visit project_new_blob_path(project, 'master', file_name: filename, **params)
end
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe 'Projects > Files > Project owner creates a license file', :js do
let(:project) { create(:project, :repository) }
let(:project_maintainer) { project.owner }
let(:project_maintainer) { project.first_owner }
before do
project.repository.delete_file(project_maintainer, 'LICENSE',
......
......@@ -6,7 +6,7 @@ RSpec.describe 'Projects > Files > Project owner sees a link to create a license
include WebIdeSpecHelpers
let(:project) { create(:project_empty_repo) }
let(:project_maintainer) { project.owner }
let(:project_maintainer) { project.first_owner }
before do
sign_in(project_maintainer)
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe 'Projects > Files > Template type dropdown selector', :js do
let(:project) { create(:project, :repository) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in user
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe 'Projects > Files > Template Undo Button', :js do
let(:project) { create(:project, :repository) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in user
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
# This is a regression test for https://gitlab.com/gitlab-org/gitlab-foss/issues/37569
RSpec.describe 'Projects > Files > User browses a tree with a folder containing only a folder', :js do
let(:project) { create(:project, :empty_repo) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
project.repository.create_dir(user, 'foo/bar', branch_name: 'master', message: 'Add the foo/bar folder')
......
......@@ -13,7 +13,7 @@ RSpec.describe "User browses files", :js do
let(:project) { create(:project, :repository, name: "Shop") }
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(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in(user)
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe 'Projects > Files > User browses LFS files' do
let(:project) { create(:project, :repository) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in(user)
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe 'Projects > Files > User searches for files' do
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in(user)
......
......@@ -6,7 +6,7 @@ RSpec.describe 'GFM autocomplete loading', :js do
let(:project) { create(:project) }
before do
sign_in(project.owner)
sign_in(project.first_owner)
visit project_path(project)
end
......
......@@ -6,7 +6,7 @@ RSpec.describe 'User uploads new design', :js do
include DesignManagementTestHelpers
let(:project) { create(:project_empty_repo, :public) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:issue) { create(:issue, project: project) }
before do
......
......@@ -6,7 +6,7 @@ RSpec.describe 'Projects > Members > Owner cannot leave project' do
let(:project) { create(:project) }
before do
sign_in(project.owner)
sign_in(project.first_owner)
visit project_path(project)
end
......
......@@ -6,7 +6,7 @@ RSpec.describe 'Projects > Members > Owner cannot request access to their own pr
let(:project) { create(:project) }
before do
sign_in(project.owner)
sign_in(project.first_owner)
visit project_path(project)
end
......
......@@ -6,7 +6,7 @@ RSpec.describe 'Projects > Members > User requests access', :js do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :public, :repository) }
let(:maintainer) { project.owner }
let(:maintainer) { project.first_owner }
before do
sign_in(user)
......
......@@ -10,7 +10,7 @@ RSpec.describe 'Project navbar' do
let_it_be(:project) { create(:project, :repository) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in(user)
......
......@@ -715,7 +715,7 @@ RSpec.describe 'Pipeline', :js do
let(:schedule) do
create(:ci_pipeline_schedule,
project: project,
owner: project.owner,
owner: project.first_owner,
description: 'blocked user schedule'
).tap do |schedule|
schedule.update_column(:next_run_at, 1.minute.ago)
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe 'Projects > Settings > For a forked project', :js do
let_it_be(:project) { create(:project, :repository, create_templates: :issue) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in(user)
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe 'Projects > Settings > Packages', :js do
let_it_be(:project) { create(:project) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in(user)
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe 'Projects settings' do
let_it_be(:project) { create(:project) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:panel) { find('.general-settings', match: :first) }
let(:button) { panel.find('.btn.gl-button.js-settings-toggle') }
let(:title) { panel.find('.settings-title') }
......
......@@ -4,7 +4,7 @@ require "spec_helper"
RSpec.describe "User interacts with deploy keys", :js do
let(:project) { create(:project, :repository) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in(user)
......
......@@ -47,7 +47,7 @@ RSpec.describe 'Projects > Show > Redirects' do
it 'redirects to private project page after sign in' do
visit project_path(private_project)
owner = private_project.owner
owner = private_project.first_owner
fill_in 'user_login', with: owner.email
fill_in 'user_password', with: owner.password
click_button 'Sign in'
......
......@@ -6,7 +6,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do
let(:project) { create(:project, :public, :repository) }
before do
sign_in(project.owner)
sign_in(project.first_owner)
end
def click_notifications_button
......
......@@ -6,7 +6,7 @@ RSpec.describe 'Projects > Show > User sees a deletion failure message' do
let(:project) { create(:project, :empty_repo, pending_delete: true) }
before do
sign_in(project.owner)
sign_in(project.first_owner)
end
it 'shows error message if deletion for project fails' do
......
......@@ -61,7 +61,7 @@ RSpec.describe 'Projects > Show > User sees Git instructions' do
let_it_be(:project) { create(:project, :public) }
before do
sign_in(project.owner)
sign_in(project.first_owner)
visit project_path(project)
end
......@@ -77,7 +77,7 @@ RSpec.describe 'Projects > Show > User sees Git instructions' do
.at_least(:once)
.and_return('example_branch')
sign_in(project.owner)
sign_in(project.first_owner)
visit project_path(project)
end
......
......@@ -43,9 +43,9 @@ RSpec.describe 'User changes public project visibility', :js do
context 'when the project has forks' do
before do
fork_project(project, project.owner)
fork_project(project, project.first_owner)
sign_in(project.owner)
sign_in(project.first_owner)
visit edit_project_path(project)
end
......@@ -84,7 +84,7 @@ RSpec.describe 'User changes public project visibility', :js do
let(:project) { create(:project, :empty_repo, :public) }
before do
sign_in(project.owner)
sign_in(project.first_owner)
visit edit_project_path(project)
end
......@@ -98,9 +98,9 @@ RSpec.describe 'User changes public project visibility', :js do
before do
stub_feature_flags(unlink_fork_network_upon_visibility_decrease: false)
fork_project(project, project.owner)
fork_project(project, project.first_owner)
sign_in(project.owner)
sign_in(project.first_owner)
visit edit_project_path(project)
end
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe 'User uses shortcuts', :js do
let_it_be(:project) { create(:project, :repository) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in(user)
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe 'Projects > Wiki > User views wiki in project page' do
before do
sign_in(project.owner)
sign_in(project.first_owner)
end
context 'when repository is disabled for project' do
......
......@@ -59,7 +59,7 @@ RSpec.describe 'Project' do
let(:path) { project_path(project) }
before do
sign_in(project.owner)
sign_in(project.first_owner)
end
it 'parses Markdown' do
......@@ -123,7 +123,7 @@ RSpec.describe 'Project' do
let(:path) { project_path(project) }
before do
sign_in(project.owner)
sign_in(project.first_owner)
visit path
end
......@@ -154,7 +154,7 @@ RSpec.describe 'Project' do
let(:path) { project_path(project) }
before do
sign_in(project.owner)
sign_in(project.first_owner)
visit path
end
......@@ -201,7 +201,7 @@ RSpec.describe 'Project' do
it 'does not show the name of the deleted project when the source was deleted', :sidekiq_might_not_need_inline do
forked_project
Projects::DestroyService.new(base_project, base_project.owner).execute
Projects::DestroyService.new(base_project, base_project.first_owner).execute
visit project_path(forked_project)
......
......@@ -6,7 +6,7 @@ RSpec.describe 'Protected Tags', :js do
include ProtectedTagHelpers
let(:project) { create(:project, :repository) }
let(:user) { project.owner }
let(:user) { project.first_owner }
before do
sign_in(user)
......
......@@ -6,8 +6,8 @@ RSpec.describe "Internal Project Snippets Access" do
include AccessMatchers
let_it_be(:project) { create(:project, :internal) }
let_it_be(:internal_snippet) { create(:project_snippet, :internal, project: project, author: project.owner) }
let_it_be(:private_snippet) { create(:project_snippet, :private, project: project, author: project.owner) }
let_it_be(:internal_snippet) { create(:project_snippet, :internal, project: project, author: project.first_owner) }
let_it_be(:private_snippet) { create(:project_snippet, :private, project: project, author: project.first_owner) }
describe "GET /:project_path/snippets" do
subject { project_snippets_path(project) }
......
......@@ -6,7 +6,7 @@ RSpec.describe "Private Project Snippets Access" do
include AccessMatchers
let_it_be(:project) { create(:project, :private) }
let_it_be(:private_snippet) { create(:project_snippet, :private, project: project, author: project.owner) }
let_it_be(:private_snippet) { create(:project_snippet, :private, project: project, author: project.first_owner) }
describe "GET /:project_path/snippets" do
subject { project_snippets_path(project) }
......
......@@ -6,9 +6,9 @@ RSpec.describe "Public Project Snippets Access" do
include AccessMatchers
let_it_be(:project) { create(:project, :public) }
let_it_be(:public_snippet) { create(:project_snippet, :public, project: project, author: project.owner) }
let_it_be(:internal_snippet) { create(:project_snippet, :internal, project: project, author: project.owner) }
let_it_be(:private_snippet) { create(:project_snippet, :private, project: project, author: project.owner) }
let_it_be(:public_snippet) { create(:project_snippet, :public, project: project, author: project.first_owner) }
let_it_be(:internal_snippet) { create(:project_snippet, :internal, project: project, author: project.first_owner) }
let_it_be(:private_snippet) { create(:project_snippet, :private, project: project, author: project.first_owner) }
describe "GET /:project_path/snippets" do
subject { project_snippets_path(project) }
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe 'Snippets' do
context 'when the project has snippets' do
let(:project) { create(:project, :public) }
let!(:snippets) { create_list(:project_snippet, 2, :public, author: project.owner, project: project) }
let!(:snippets) { create_list(:project_snippet, 2, :public, author: project.first_owner, project: project) }
before do
allow(Snippet).to receive(:default_per_page).and_return(1)
......
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