Commit 40f62bae authored by James Edwards-Jones's avatar James Edwards-Jones

Test for GithubService license uses silver/premium

parent d2bd7606
...@@ -1084,7 +1084,7 @@ describe Project do ...@@ -1084,7 +1084,7 @@ describe Project do
describe '#disabled_services' do describe '#disabled_services' do
let(:namespace) { create(:group, :private) } let(:namespace) { create(:group, :private) }
let(:project) { create(:project, :private, namespace: namespace) } let(:project) { create(:project, :private, namespace: namespace) }
let(:disabled_services) { %w(jenkins jenkins_deprecated) } let(:disabled_services) { %w(jenkins jenkins_deprecated github) }
context 'without a license key' do context 'without a license key' do
before do before do
...@@ -1095,6 +1095,10 @@ describe Project do ...@@ -1095,6 +1095,10 @@ describe Project do
end end
context 'with a license key' do context 'with a license key' do
before do
allow_any_instance_of(License).to receive(:plan).and_return(License::PREMIUM_PLAN)
end
context 'when checking of namespace plan is enabled' do context 'when checking of namespace plan is enabled' do
before do before do
stub_application_setting_on_object(project, should_check_namespace_plan: true) stub_application_setting_on_object(project, should_check_namespace_plan: true)
...@@ -1105,7 +1109,7 @@ describe Project do ...@@ -1105,7 +1109,7 @@ describe Project do
end end
context 'and namespace has a plan' do context 'and namespace has a plan' do
let(:namespace) { create(:group, :private, plan: :bronze_plan) } let(:namespace) { create(:group, :private, plan: :silver_plan) }
it_behaves_like 'project without disabled services' it_behaves_like 'project without disabled services'
end end
......
...@@ -26,6 +26,14 @@ Service.available_services_names.each do |service| ...@@ -26,6 +26,14 @@ Service.available_services_names.each do |service|
end end
end end
before do
if service == 'github'
stub_licensed_features(github_project_service_integration: true)
project.clear_memoization(:disabled_services)
project.clear_memoization(:licensed_feature_available)
end
end
def initialize_service(service) def initialize_service(service)
service_item = project.find_or_initialize_service(service) service_item = project.find_or_initialize_service(service)
service_item.properties = service_attrs service_item.properties = service_attrs
......
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