diff options
Diffstat (limited to 'spec/models/integrations/base_third_party_wiki_spec.rb')
-rw-r--r-- | spec/models/integrations/base_third_party_wiki_spec.rb | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/spec/models/integrations/base_third_party_wiki_spec.rb b/spec/models/integrations/base_third_party_wiki_spec.rb deleted file mode 100644 index 763f7131b94..00000000000 --- a/spec/models/integrations/base_third_party_wiki_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Integrations::BaseThirdPartyWiki, feature_category: :integrations do - describe 'default values' do - it { expect(subject.category).to eq(:third_party_wiki) } - end - - describe 'Validations' do - let_it_be_with_reload(:project) { create(:project) } - - describe 'only one third party wiki per project' do - subject(:integration) { build(:shimo_integration, project: project, active: true) } - - before_all do - create(:confluence_integration, project: project, active: true) - end - - context 'when integration is changed manually by user' do - it 'executes the validation' do - valid = integration.valid?(:manual_change) - - expect(valid).to be_falsey - error_message = 'Another third-party wiki is already in use. '\ - 'Only one third-party wiki integration can be active at a time' - expect(integration.errors[:base]).to include _(error_message) - end - end - - context 'when integration is changed internally' do - it 'does not execute the validation' do - expect(integration.valid?).to be_truthy - end - end - - context 'when integration is not on the project level' do - subject(:integration) { build(:shimo_integration, :instance, active: true) } - - it 'executes the validation' do - expect(integration.valid?(:manual_change)).to be_truthy - end - end - end - end -end |