diff options
Diffstat (limited to 'spec/helpers/services_helper_spec.rb')
-rw-r--r-- | spec/helpers/services_helper_spec.rb | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/spec/helpers/services_helper_spec.rb b/spec/helpers/services_helper_spec.rb index 534f33d9b5a..3b08393ebdf 100644 --- a/spec/helpers/services_helper_spec.rb +++ b/spec/helpers/services_helper_spec.rb @@ -4,32 +4,49 @@ require 'spec_helper' RSpec.describe ServicesHelper do describe '#integration_form_data' do + let(:fields) do + [ + :id, + :show_active, + :activated, + :type, + :merge_request_events, + :commit_events, + :enable_comments, + :comment_detail, + :learn_more_path, + :trigger_events, + :fields, + :inherit_from_id, + :integration_level, + :editable, + :cancel_path, + :can_test, + :test_path, + :reset_path + ] + end + + let(:jira_fields) { %i[jira_issue_transition_id] } + subject { helper.integration_form_data(integration) } - context 'Jira service' do - let(:integration) { build(:jira_service) } + context 'Slack service' do + let(:integration) { build(:slack_service) } - it 'includes Jira specific fields' do - is_expected.to include( - :id, - :show_active, - :activated, - :type, - :merge_request_events, - :commit_events, - :enable_comments, - :comment_detail, - :trigger_events, - :fields, - :inherit_from_id, - :integration_level - ) - end + it { is_expected.to include(*fields) } + it { is_expected.not_to include(*jira_fields) } specify do expect(subject[:reset_path]).to eq(helper.scoped_reset_integration_path(integration)) end end + + context 'Jira service' do + let(:integration) { build(:jira_service) } + + it { is_expected.to include(*fields, *jira_fields) } + end end describe '#scoped_reset_integration_path' do |