Commit 2c601eb7 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'zj-wiki-gitaly-fix' into 'master'

Bump Gitaly to 0.98.0

See merge request gitlab-org/gitlab-ce!18740
parents 6fb1dc67 40655a48
...@@ -416,7 +416,7 @@ group :ed25519 do ...@@ -416,7 +416,7 @@ group :ed25519 do
end end
# Gitaly GRPC client # Gitaly GRPC client
gem 'gitaly-proto', '~> 0.97.0', require: 'gitaly' gem 'gitaly-proto', '~> 0.99.0', require: 'gitaly'
gem 'grpc', '~> 1.11.0' gem 'grpc', '~> 1.11.0'
# Locked until https://github.com/google/protobuf/issues/4210 is closed # Locked until https://github.com/google/protobuf/issues/4210 is closed
......
...@@ -291,7 +291,7 @@ GEM ...@@ -291,7 +291,7 @@ GEM
po_to_json (>= 1.0.0) po_to_json (>= 1.0.0)
rails (>= 3.2.0) rails (>= 3.2.0)
gherkin-ruby (0.3.2) gherkin-ruby (0.3.2)
gitaly-proto (0.97.0) gitaly-proto (0.99.0)
google-protobuf (~> 3.1) google-protobuf (~> 3.1)
grpc (~> 1.10) grpc (~> 1.10)
github-linguist (5.3.3) github-linguist (5.3.3)
...@@ -1060,7 +1060,7 @@ DEPENDENCIES ...@@ -1060,7 +1060,7 @@ DEPENDENCIES
gettext (~> 3.2.2) gettext (~> 3.2.2)
gettext_i18n_rails (~> 1.8.0) gettext_i18n_rails (~> 1.8.0)
gettext_i18n_rails_js (~> 1.3) gettext_i18n_rails_js (~> 1.3)
gitaly-proto (~> 0.97.0) gitaly-proto (~> 0.99.0)
github-linguist (~> 5.3.3) github-linguist (~> 5.3.3)
gitlab-flowdock-git-hook (~> 1.0.1) gitlab-flowdock-git-hook (~> 1.0.1)
gitlab-gollum-lib (~> 4.2) gitlab-gollum-lib (~> 4.2)
......
...@@ -2,7 +2,7 @@ FactoryBot.define do ...@@ -2,7 +2,7 @@ FactoryBot.define do
factory :project_wiki do factory :project_wiki do
skip_create skip_create
project association :project, :wiki_repo
user { project.creator } user { project.creator }
initialize_with { new(project, user) } initialize_with { new(project, user) }
end end
......
...@@ -193,6 +193,13 @@ FactoryBot.define do ...@@ -193,6 +193,13 @@ FactoryBot.define do
trait :wiki_repo do trait :wiki_repo do
after(:create) do |project| after(:create) do |project|
raise 'Failed to create wiki repository!' unless project.create_wiki raise 'Failed to create wiki repository!' unless project.create_wiki
# We delete hooks so that gitlab-shell will not try to authenticate with
# an API that isn't running
project.gitlab_shell.rm_directory(
project.repository_storage,
File.join("#{project.wiki.repository.disk_path}.git", "hooks")
)
end end
end end
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Projects > Wiki > User previews markdown changes', :js do feature 'Projects > Wiki > User previews markdown changes', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let(:wiki_content) do let(:wiki_content) do
<<-HEREDOC <<-HEREDOC
[regular link](regular) [regular link](regular)
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Wiki shortcuts', :js do feature 'Wiki shortcuts', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let(:wiki_page) { create(:wiki_page, wiki: project.wiki, attrs: { title: 'home', content: 'Home page' }) } let(:wiki_page) { create(:wiki_page, wiki: project.wiki, attrs: { title: 'home', content: 'Home page' }) }
before do before do
......
...@@ -12,7 +12,7 @@ describe "User creates wiki page" do ...@@ -12,7 +12,7 @@ describe "User creates wiki page" do
context "when wiki is empty" do context "when wiki is empty" do
context "in a user namespace" do context "in a user namespace" do
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
it "shows validation error message" do it "shows validation error message" do
page.within(".wiki-form") do page.within(".wiki-form") do
...@@ -142,7 +142,7 @@ describe "User creates wiki page" do ...@@ -142,7 +142,7 @@ describe "User creates wiki page" do
end end
context "in a group namespace", :js do context "in a group namespace", :js do
let(:project) { create(:project, namespace: create(:group, :public)) } let(:project) { create(:project, :wiki_repo, namespace: create(:group, :public)) }
it "has `Create home` as a commit message" do it "has `Create home` as a commit message" do
expect(page).to have_field("wiki[message]", with: "Create home") expect(page).to have_field("wiki[message]", with: "Create home")
...@@ -164,11 +164,11 @@ describe "User creates wiki page" do ...@@ -164,11 +164,11 @@ describe "User creates wiki page" do
context "when wiki is not empty", :js do context "when wiki is not empty", :js do
before do before do
create(:wiki_page, wiki: create(:project, namespace: user.namespace).wiki, attrs: { title: "home", content: "Home page" }) create(:wiki_page, wiki: create(:project, :wiki_repo, namespace: user.namespace).wiki, attrs: { title: "home", content: "Home page" })
end end
context "in a user namespace" do context "in a user namespace" do
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
context "via the `new wiki page` page" do context "via the `new wiki page` page" do
it "creates a page with a single word" do it "creates a page with a single word" do
...@@ -261,7 +261,7 @@ describe "User creates wiki page" do ...@@ -261,7 +261,7 @@ describe "User creates wiki page" do
end end
context "in a group namespace" do context "in a group namespace" do
let(:project) { create(:project, namespace: create(:group, :public)) } let(:project) { create(:project, :wiki_repo, namespace: create(:group, :public)) }
context "via the `new wiki page` page" do context "via the `new wiki page` page" do
it "creates a page" do it "creates a page" do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'User deletes wiki page' do feature 'User deletes wiki page' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let(:wiki_page) { create(:wiki_page, wiki: project.wiki) } let(:wiki_page) { create(:wiki_page, wiki: project.wiki) }
before do before do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Projects > Wiki > User views Git access wiki page' do describe 'Projects > Wiki > User views Git access wiki page' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :wiki_repo, :public) }
let(:wiki_page) { create(:wiki_page, wiki: project.wiki, attrs: { title: 'home', content: '[some link](other-page)' }) } let(:wiki_page) { create(:wiki_page, wiki: project.wiki, attrs: { title: 'home', content: '[some link](other-page)' }) }
before do before do
......
...@@ -14,7 +14,7 @@ describe 'User updates wiki page' do ...@@ -14,7 +14,7 @@ describe 'User updates wiki page' do
end end
context 'in a user namespace' do context 'in a user namespace' do
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
it 'redirects back to the home edit page' do it 'redirects back to the home edit page' do
page.within(:css, '.wiki-form .form-actions') do page.within(:css, '.wiki-form .form-actions') do
...@@ -66,7 +66,7 @@ describe 'User updates wiki page' do ...@@ -66,7 +66,7 @@ describe 'User updates wiki page' do
end end
context 'in a user namespace' do context 'in a user namespace' do
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
it 'updates a page' do it 'updates a page' do
click_link('Edit') click_link('Edit')
...@@ -134,7 +134,7 @@ describe 'User updates wiki page' do ...@@ -134,7 +134,7 @@ describe 'User updates wiki page' do
end end
context 'in a group namespace' do context 'in a group namespace' do
let(:project) { create(:project, namespace: create(:group, :public)) } let(:project) { create(:project, :wiki_repo, namespace: create(:group, :public)) }
it 'updates a page' do it 'updates a page' do
click_link('Edit') click_link('Edit')
...@@ -154,7 +154,7 @@ describe 'User updates wiki page' do ...@@ -154,7 +154,7 @@ describe 'User updates wiki page' do
end end
context 'when the page is in a subdir' do context 'when the page is in a subdir' do
let!(:project) { create(:project, namespace: user.namespace) } let!(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let(:project_wiki) { create(:project_wiki, project: project, user: project.creator) } let(:project_wiki) { create(:project_wiki, project: project, user: project.creator) }
let(:page_name) { 'page_name' } let(:page_name) { 'page_name' }
let(:page_dir) { "foo/bar/#{page_name}" } let(:page_dir) { "foo/bar/#{page_name}" }
......
...@@ -11,6 +11,7 @@ describe 'Projects > Wiki > User views wiki in project page' do ...@@ -11,6 +11,7 @@ describe 'Projects > Wiki > User views wiki in project page' do
context 'when repository is disabled for project' do context 'when repository is disabled for project' do
let(:project) do let(:project) do
create(:project, create(:project,
:wiki_repo,
:repository_disabled, :repository_disabled,
:merge_requests_disabled, :merge_requests_disabled,
:builds_disabled) :builds_disabled)
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'User views a wiki page' do describe 'User views a wiki page' do
shared_examples 'wiki page user view' do shared_examples 'wiki page user view' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let(:wiki_page) do let(:wiki_page) do
create(:wiki_page, create(:wiki_page,
wiki: project.wiki, wiki: project.wiki,
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'User searches for wiki pages', :js do describe 'User searches for wiki pages', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let!(:wiki_page) { create(:wiki_page, wiki: project.wiki, attrs: { title: 'test_wiki', content: 'Some Wiki content' }) } let!(:wiki_page) { create(:wiki_page, wiki: project.wiki, attrs: { title: 'test_wiki', content: 'Some Wiki content' }) }
before do before do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Backup::Repository do describe Backup::Repository do
let(:progress) { StringIO.new } let(:progress) { StringIO.new }
let!(:project) { create(:project) } let!(:project) { create(:project, :wiki_repo) }
before do before do
allow(progress).to receive(:puts) allow(progress).to receive(:puts)
...@@ -102,7 +102,7 @@ describe Backup::Repository do ...@@ -102,7 +102,7 @@ describe Backup::Repository do
it 'invalidates the emptiness cache' do it 'invalidates the emptiness cache' do
expect(wiki.repository).to receive(:expire_emptiness_caches).once expect(wiki.repository).to receive(:expire_emptiness_caches).once
wiki.empty? described_class.new.send(:empty_repo?, wiki)
end end
context 'wiki repo has content' do context 'wiki repo has content' do
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::DataBuilder::WikiPage do describe Gitlab::DataBuilder::WikiPage do
let(:project) { create(:project, :repository) } set(:project) { create(:project, :repository, :wiki_repo) }
let(:wiki_page) { create(:wiki_page, wiki: project.wiki) } let(:wiki_page) { create(:wiki_page, wiki: project.wiki) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe Gitlab::ImportExport::WikiRepoSaver do describe Gitlab::ImportExport::WikiRepoSaver do
describe 'bundle a wiki Git repo' do describe 'bundle a wiki Git repo' do
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:project) { create(:project, :public, name: 'searchable_project') } let!(:project) { create(:project, :public, :wiki_repo, name: 'searchable_project') }
let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" } let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" }
let(:shared) { project.import_export_shared } let(:shared) { project.import_export_shared }
let(:wiki_bundler) { described_class.new(project: project, shared: shared) } let(:wiki_bundler) { described_class.new(project: project, shared: shared) }
......
...@@ -175,14 +175,14 @@ describe Gitlab::ProjectSearchResults do ...@@ -175,14 +175,14 @@ describe Gitlab::ProjectSearchResults do
end end
describe 'wiki search' do describe 'wiki search' do
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :wiki_repo) }
let(:wiki) { build(:project_wiki, project: project) } let(:wiki) { build(:project_wiki, project: project) }
let!(:wiki_page) { wiki.create_page('Title', 'Content') } let!(:wiki_page) { wiki.create_page('Title', 'Content') }
subject(:results) { described_class.new(user, project, 'Content').objects('wiki_blobs') } subject(:results) { described_class.new(user, project, 'Content').objects('wiki_blobs') }
context 'when wiki is disabled' do context 'when wiki is disabled' do
let(:project) { create(:project, :public, :wiki_disabled) } let(:project) { create(:project, :public, :wiki_repo, :wiki_disabled) }
it 'hides wiki blobs from members' do it 'hides wiki blobs from members' do
project.add_reporter(user) project.add_reporter(user)
...@@ -196,7 +196,7 @@ describe Gitlab::ProjectSearchResults do ...@@ -196,7 +196,7 @@ describe Gitlab::ProjectSearchResults do
end end
context 'when wiki is internal' do context 'when wiki is internal' do
let(:project) { create(:project, :public, :wiki_private) } let(:project) { create(:project, :public, :wiki_repo, :wiki_private) }
it 'finds wiki blobs for guest' do it 'finds wiki blobs for guest' do
project.add_guest(user) project.add_guest(user)
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe BlobViewer::Readme do describe BlobViewer::Readme do
include FakeBlobHelpers include FakeBlobHelpers
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository, :wiki_repo) }
let(:blob) { fake_blob(path: 'README.md') } let(:blob) { fake_blob(path: 'README.md') }
subject { described_class.new(blob) } subject { described_class.new(blob) }
......
...@@ -30,7 +30,7 @@ describe MicrosoftTeamsService do ...@@ -30,7 +30,7 @@ describe MicrosoftTeamsService do
describe "#execute" do describe "#execute" do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository) } set(:project) { create(:project, :repository, :wiki_repo) }
before do before do
allow(chat_service).to receive_messages( allow(chat_service).to receive_messages(
......
require "spec_helper" require "spec_helper"
describe ProjectWiki do describe ProjectWiki do
let(:project) { create(:project) } let(:project) { create(:project, :wiki_repo) }
let(:repository) { project.repository } let(:repository) { project.repository }
let(:user) { project.owner } let(:user) { project.owner }
let(:gitlab_shell) { Gitlab::Shell.new } let(:gitlab_shell) { Gitlab::Shell.new }
...@@ -328,6 +328,8 @@ describe ProjectWiki do ...@@ -328,6 +328,8 @@ describe ProjectWiki do
end end
describe '#create_repo!' do describe '#create_repo!' do
let(:project) { create(:project) }
it 'creates a repository' do it 'creates a repository' do
expect(raw_repository.exists?).to eq(false) expect(raw_repository.exists?).to eq(false)
expect(subject.repository).to receive(:after_create) expect(subject.repository).to receive(:after_create)
...@@ -339,6 +341,8 @@ describe ProjectWiki do ...@@ -339,6 +341,8 @@ describe ProjectWiki do
end end
describe '#ensure_repository' do describe '#ensure_repository' do
let(:project) { create(:project) }
it 'creates the repository if it not exist' do it 'creates the repository if it not exist' do
expect(raw_repository.exists?).to eq(false) expect(raw_repository.exists?).to eq(false)
......
require "spec_helper" require "spec_helper"
describe WikiPage do describe WikiPage do
let(:project) { create(:project) } let(:project) { create(:project, :wiki_repo) }
let(:user) { project.owner } let(:user) { project.owner }
let(:wiki) { ProjectWiki.new(project, user) } let(:wiki) { ProjectWiki.new(project, user) }
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe API::Search do describe API::Search do
set(:user) { create(:user) } set(:user) { create(:user) }
set(:group) { create(:group) } set(:group) { create(:group) }
set(:project) { create(:project, :public, name: 'awesome project', group: group) } set(:project) { create(:project, :wiki_repo, :public, name: 'awesome project', group: group) }
set(:repo_project) { create(:project, :public, :repository, group: group) } set(:repo_project) { create(:project, :public, :repository, group: group) }
shared_examples 'response is correct' do |schema:, size: 1| shared_examples 'response is correct' do |schema:, size: 1|
......
...@@ -143,7 +143,7 @@ describe API::Wikis do ...@@ -143,7 +143,7 @@ describe API::Wikis do
let(:url) { "/projects/#{project.id}/wikis" } let(:url) { "/projects/#{project.id}/wikis" }
context 'when wiki is disabled' do context 'when wiki is disabled' do
let(:project) { create(:project, :wiki_disabled) } let(:project) { create(:project, :wiki_repo, :wiki_disabled) }
context 'when user is guest' do context 'when user is guest' do
before do before do
...@@ -175,7 +175,7 @@ describe API::Wikis do ...@@ -175,7 +175,7 @@ describe API::Wikis do
end end
context 'when wiki is available only for team members' do context 'when wiki is available only for team members' do
let(:project) { create(:project, :wiki_private) } let(:project) { create(:project, :wiki_repo, :wiki_private) }
context 'when user is guest' do context 'when user is guest' do
before do before do
...@@ -203,7 +203,7 @@ describe API::Wikis do ...@@ -203,7 +203,7 @@ describe API::Wikis do
end end
context 'when wiki is available for everyone with access' do context 'when wiki is available for everyone with access' do
let(:project) { create(:project) } let(:project) { create(:project, :wiki_repo) }
context 'when user is guest' do context 'when user is guest' do
before do before do
...@@ -236,7 +236,7 @@ describe API::Wikis do ...@@ -236,7 +236,7 @@ describe API::Wikis do
let(:url) { "/projects/#{project.id}/wikis/#{page.slug}" } let(:url) { "/projects/#{project.id}/wikis/#{page.slug}" }
context 'when wiki is disabled' do context 'when wiki is disabled' do
let(:project) { create(:project, :wiki_disabled) } let(:project) { create(:project, :wiki_repo, :wiki_disabled) }
context 'when user is guest' do context 'when user is guest' do
before do before do
...@@ -268,7 +268,7 @@ describe API::Wikis do ...@@ -268,7 +268,7 @@ describe API::Wikis do
end end
context 'when wiki is available only for team members' do context 'when wiki is available only for team members' do
let(:project) { create(:project, :wiki_private) } let(:project) { create(:project, :wiki_repo, :wiki_private) }
context 'when user is guest' do context 'when user is guest' do
before do before do
...@@ -311,7 +311,7 @@ describe API::Wikis do ...@@ -311,7 +311,7 @@ describe API::Wikis do
end end
context 'when wiki is available for everyone with access' do context 'when wiki is available for everyone with access' do
let(:project) { create(:project) } let(:project) { create(:project, :wiki_repo) }
context 'when user is guest' do context 'when user is guest' do
before do before do
...@@ -360,7 +360,7 @@ describe API::Wikis do ...@@ -360,7 +360,7 @@ describe API::Wikis do
let(:url) { "/projects/#{project.id}/wikis" } let(:url) { "/projects/#{project.id}/wikis" }
context 'when wiki is disabled' do context 'when wiki is disabled' do
let(:project) { create(:project, :wiki_disabled) } let(:project) { create(:project, :wiki_disabled, :wiki_repo) }
context 'when user is guest' do context 'when user is guest' do
before do before do
...@@ -390,7 +390,7 @@ describe API::Wikis do ...@@ -390,7 +390,7 @@ describe API::Wikis do
end end
context 'when wiki is available only for team members' do context 'when wiki is available only for team members' do
let(:project) { create(:project, :wiki_private) } let(:project) { create(:project, :wiki_private, :wiki_repo) }
context 'when user is guest' do context 'when user is guest' do
before do before do
...@@ -418,7 +418,7 @@ describe API::Wikis do ...@@ -418,7 +418,7 @@ describe API::Wikis do
end end
context 'when wiki is available for everyone with access' do context 'when wiki is available for everyone with access' do
let(:project) { create(:project) } let(:project) { create(:project, :wiki_repo) }
context 'when user is guest' do context 'when user is guest' do
before do before do
...@@ -452,7 +452,7 @@ describe API::Wikis do ...@@ -452,7 +452,7 @@ describe API::Wikis do
let(:url) { "/projects/#{project.id}/wikis/#{page.slug}" } let(:url) { "/projects/#{project.id}/wikis/#{page.slug}" }
context 'when wiki is disabled' do context 'when wiki is disabled' do
let(:project) { create(:project, :wiki_disabled) } let(:project) { create(:project, :wiki_disabled, :wiki_repo) }
context 'when user is guest' do context 'when user is guest' do
before do before do
...@@ -484,7 +484,7 @@ describe API::Wikis do ...@@ -484,7 +484,7 @@ describe API::Wikis do
end end
context 'when wiki is available only for team members' do context 'when wiki is available only for team members' do
let(:project) { create(:project, :wiki_private) } let(:project) { create(:project, :wiki_private, :wiki_repo) }
context 'when user is guest' do context 'when user is guest' do
before do before do
...@@ -528,7 +528,7 @@ describe API::Wikis do ...@@ -528,7 +528,7 @@ describe API::Wikis do
end end
context 'when wiki is available for everyone with access' do context 'when wiki is available for everyone with access' do
let(:project) { create(:project) } let(:project) { create(:project, :wiki_repo) }
context 'when user is guest' do context 'when user is guest' do
before do before do
...@@ -572,7 +572,7 @@ describe API::Wikis do ...@@ -572,7 +572,7 @@ describe API::Wikis do
end end
context 'when wiki belongs to a group project' do context 'when wiki belongs to a group project' do
let(:project) { create(:project, namespace: group) } let(:project) { create(:project, :wiki_repo, namespace: group) }
before do before do
put(api(url, user), payload) put(api(url, user), payload)
...@@ -587,7 +587,7 @@ describe API::Wikis do ...@@ -587,7 +587,7 @@ describe API::Wikis do
let(:url) { "/projects/#{project.id}/wikis/#{page.slug}" } let(:url) { "/projects/#{project.id}/wikis/#{page.slug}" }
context 'when wiki is disabled' do context 'when wiki is disabled' do
let(:project) { create(:project, :wiki_disabled) } let(:project) { create(:project, :wiki_disabled, :wiki_repo) }
context 'when user is guest' do context 'when user is guest' do
before do before do
...@@ -619,7 +619,7 @@ describe API::Wikis do ...@@ -619,7 +619,7 @@ describe API::Wikis do
end end
context 'when wiki is available only for team members' do context 'when wiki is available only for team members' do
let(:project) { create(:project, :wiki_private) } let(:project) { create(:project, :wiki_private, :wiki_repo) }
context 'when user is guest' do context 'when user is guest' do
before do before do
...@@ -651,7 +651,7 @@ describe API::Wikis do ...@@ -651,7 +651,7 @@ describe API::Wikis do
end end
context 'when wiki is available for everyone with access' do context 'when wiki is available for everyone with access' do
let(:project) { create(:project) } let(:project) { create(:project, :wiki_repo) }
context 'when user is guest' do context 'when user is guest' do
before do before do
...@@ -689,7 +689,7 @@ describe API::Wikis do ...@@ -689,7 +689,7 @@ describe API::Wikis do
end end
context 'when wiki belongs to a group project' do context 'when wiki belongs to a group project' do
let(:project) { create(:project, namespace: group) } let(:project) { create(:project, :wiki_repo, namespace: group) }
before do before do
delete(api(url, user)) delete(api(url, user))
......
...@@ -170,6 +170,7 @@ describe TestHooks::ProjectService do ...@@ -170,6 +170,7 @@ describe TestHooks::ProjectService do
end end
context 'wiki_page_events' do context 'wiki_page_events' do
let(:project) { create(:project, :wiki_repo) }
let(:trigger) { 'wiki_page_events' } let(:trigger) { 'wiki_page_events' }
let(:trigger_key) { :wiki_page_hooks } let(:trigger_key) { :wiki_page_hooks }
......
require 'spec_helper' require 'spec_helper'
describe WikiPages::CreateService do describe WikiPages::CreateService do
let(:project) { create(:project) } let(:project) { create(:project, :wiki_repo) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:opts) do let(:opts) do
......
...@@ -35,7 +35,7 @@ RSpec.shared_examples 'slack or mattermost notifications' do ...@@ -35,7 +35,7 @@ RSpec.shared_examples 'slack or mattermost notifications' do
describe "#execute" do describe "#execute" do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository, :wiki_repo) }
let(:username) { 'slack_username' } let(:username) { 'slack_username' }
let(:channel) { 'slack_channel' } let(:channel) { 'slack_channel' }
let(:issue_service_options) { { title: 'Awesome issue', description: 'please fix' } } let(:issue_service_options) { { title: 'Awesome issue', description: 'please fix' } }
......
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