debian-mirror-gitlab/spec/features/projects/services/disable_triggers_spec.rb

34 lines
857 B
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2018-03-27 19:54:05 +05:30
require 'spec_helper'
describe 'Disable individual triggers' do
2020-05-24 23:13:21 +05:30
include_context 'project service activation'
2018-03-27 19:54:05 +05:30
let(:checkbox_selector) { 'input[type=checkbox][id$=_events]' }
before do
2020-05-24 23:13:21 +05:30
visit_project_integration(service_name)
2018-03-27 19:54:05 +05:30
end
context 'service has multiple supported events' do
let(:service_name) { 'HipChat' }
it 'shows trigger checkboxes' do
event_count = HipchatService.supported_events.count
expect(page).to have_content "Trigger"
expect(page).to have_css(checkbox_selector, count: event_count)
end
end
context 'services only has one supported event' do
let(:service_name) { 'Asana' }
it "doesn't show unnecessary Trigger checkboxes" do
expect(page).not_to have_content "Trigger"
expect(page).not_to have_css(checkbox_selector)
end
end
end