summaryrefslogtreecommitdiff
path: root/spec/helpers/integrations_helper_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/integrations_helper_spec.rb')
-rw-r--r--spec/helpers/integrations_helper_spec.rb27
1 files changed, 26 insertions, 1 deletions
diff --git a/spec/helpers/integrations_helper_spec.rb b/spec/helpers/integrations_helper_spec.rb
index 38ce17e34ba..3bedc1d8aec 100644
--- a/spec/helpers/integrations_helper_spec.rb
+++ b/spec/helpers/integrations_helper_spec.rb
@@ -3,17 +3,41 @@
require 'spec_helper'
RSpec.describe IntegrationsHelper do
+ shared_examples 'is defined for each integration event' do
+ Integration.available_integration_names.each do |integration|
+ events = Integration.integration_name_to_model(integration).new.configurable_events
+ events.each do |event|
+ context "when integration is #{integration}, event is #{event}" do
+ let(:integration) { integration }
+ let(:event) { event }
+
+ it { is_expected.not_to be_nil }
+ end
+ end
+ end
+ end
+
+ describe '#integration_event_title' do
+ subject { helper.integration_event_title(event) }
+
+ it_behaves_like 'is defined for each integration event'
+ end
+
describe '#integration_event_description' do
- subject(:description) { helper.integration_event_description(integration, 'merge_request_events') }
+ subject { helper.integration_event_description(integration, event) }
+
+ it_behaves_like 'is defined for each integration event'
context 'when integration is Jira' do
let(:integration) { Integrations::Jira.new }
+ let(:event) { 'merge_request_events' }
it { is_expected.to include('Jira') }
end
context 'when integration is Team City' do
let(:integration) { Integrations::Teamcity.new }
+ let(:event) { 'merge_request_events' }
it { is_expected.to include('TeamCity') }
end
@@ -31,6 +55,7 @@ RSpec.describe IntegrationsHelper do
:id,
:show_active,
:activated,
+ :activate_disabled,
:type,
:merge_request_events,
:commit_events,