Commit 24062c3f authored by Kerri Miller's avatar Kerri Miller

Merge branch 'move-group-wikis-to-premium' into 'master'

Move group wikis from Starter to Premium [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!43170
parents 0e577324 638f2fe7
...@@ -18,7 +18,6 @@ class License < ApplicationRecord ...@@ -18,7 +18,6 @@ class License < ApplicationRecord
group_activity_analytics group_activity_analytics
group_bulk_edit group_bulk_edit
group_webhooks group_webhooks
group_wikis
issuable_default_templates issuable_default_templates
issue_weights issue_weights
iterations iterations
...@@ -85,6 +84,7 @@ class License < ApplicationRecord ...@@ -85,6 +84,7 @@ class License < ApplicationRecord
group_project_templates group_project_templates
group_repository_analytics group_repository_analytics
group_saml group_saml
group_wikis
ide_schema_config ide_schema_config
issues_analytics issues_analytics
jira_issues_integration jira_issues_integration
......
...@@ -5,6 +5,10 @@ require 'spec_helper' ...@@ -5,6 +5,10 @@ require 'spec_helper'
RSpec.describe Groups::WikisController do RSpec.describe Groups::WikisController do
include WikiHelpers include WikiHelpers
before do
stub_group_wikis(true)
end
it_behaves_like 'wiki controller actions' do it_behaves_like 'wiki controller actions' do
let(:container) { create(:group, :public) } let(:container) { create(:group, :public) }
let(:routing_params) { { group_id: container } } let(:routing_params) { { group_id: container } }
......
...@@ -13,6 +13,10 @@ RSpec.describe Gitlab::GitAccessWiki do ...@@ -13,6 +13,10 @@ RSpec.describe Gitlab::GitAccessWiki do
let(:access) { described_class.new(user, project, 'web', authentication_abilities: authentication_abilities, redirected_path: redirected_path) } let(:access) { described_class.new(user, project, 'web', authentication_abilities: authentication_abilities, redirected_path: redirected_path) }
before do
stub_group_wikis(true)
end
describe 'group wiki access' do describe 'group wiki access' do
let_it_be(:group, reload: true) { create(:group, :private, :wiki_repo) } let_it_be(:group, reload: true) { create(:group, :private, :wiki_repo) }
......
...@@ -314,7 +314,7 @@ RSpec.describe License do ...@@ -314,7 +314,7 @@ RSpec.describe License do
it 'returns features for premium plan' do it 'returns features for premium plan' do
expect(described_class.features_for_plan('premium')) expect(described_class.features_for_plan('premium'))
.to include(:multiple_issue_assignees, :deploy_board, :file_locks) .to include(:multiple_issue_assignees, :deploy_board, :file_locks, :group_wikis)
end end
it 'returns empty array if no features for given plan' do it 'returns empty array if no features for given plan' do
......
...@@ -1065,11 +1065,17 @@ RSpec.describe GroupPolicy do ...@@ -1065,11 +1065,17 @@ RSpec.describe GroupPolicy do
end end
it_behaves_like 'model with wiki policies' do it_behaves_like 'model with wiki policies' do
include WikiHelpers let_it_be(:container) { create(:group_with_plan, plan: :silver_plan) }
let_it_be(:container) { create(:group_with_plan, plan: :bronze_plan) }
let_it_be(:user) { owner } let_it_be(:user) { owner }
before_all do
create(:license, plan: License::PREMIUM_PLAN)
end
before do
stub_application_setting(check_namespace_plan: true)
end
# We don't have feature toggles on groups yet, so we currently simulate # We don't have feature toggles on groups yet, so we currently simulate
# this by toggling the feature flag instead. # this by toggling the feature flag instead.
def set_access_level(access_level) def set_access_level(access_level)
...@@ -1094,9 +1100,7 @@ RSpec.describe GroupPolicy do ...@@ -1094,9 +1100,7 @@ RSpec.describe GroupPolicy do
end end
context 'when the feature is not licensed on this group' do context 'when the feature is not licensed on this group' do
before do let_it_be(:container) { create(:group_with_plan, plan: :bronze_plan) }
allow(container).to receive(:feature_available?).with(:group_wikis).and_return(false)
end
it 'does not include the wiki permissions' do it 'does not include the wiki permissions' do
expect_disallowed(*wiki_permissions[:all]) expect_disallowed(*wiki_permissions[:all])
......
...@@ -23,6 +23,10 @@ RSpec.describe API::Wikis do ...@@ -23,6 +23,10 @@ RSpec.describe API::Wikis do
let(:expected_keys_with_content) { %w(content format slug title) } let(:expected_keys_with_content) { %w(content format slug title) }
let(:expected_keys_without_content) { %w(format slug title) } let(:expected_keys_without_content) { %w(format slug title) }
before do
stub_group_wikis(true)
end
shared_examples_for 'wiki API 404 Group Not Found' do shared_examples_for 'wiki API 404 Group Not Found' do
include_examples 'wiki API 404 Not Found', 'Group' include_examples 'wiki API 404 Not Found', 'Group'
end end
......
...@@ -2,5 +2,11 @@ ...@@ -2,5 +2,11 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Wikis::CreateAttachmentService do RSpec.describe Wikis::CreateAttachmentService do
include WikiHelpers
before do
stub_group_wikis(true)
end
it_behaves_like 'Wikis::CreateAttachmentService#execute', :group it_behaves_like 'Wikis::CreateAttachmentService#execute', :group
end end
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