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

34 lines
919 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'
2020-06-23 00:09:42 +05:30
RSpec.describe 'Disable individual triggers', :js do
2022-04-04 11:22:00 +05:30
include_context 'project integration activation'
2020-05-24 23:13:21 +05:30
2020-07-28 23:09:34 +05:30
let(:checkbox_selector) { 'input[name$="_events]"]' }
2018-03-27 19:54:05 +05:30
before do
2022-04-04 11:22:00 +05:30
visit_project_integration(integration_name)
2018-03-27 19:54:05 +05:30
end
2022-04-04 11:22:00 +05:30
context 'integration has multiple supported events' do
let(:integration_name) { 'Jenkins' }
2018-03-27 19:54:05 +05:30
it 'shows trigger checkboxes' do
2021-09-04 01:27:46 +05:30
event_count = Integrations::Jenkins.supported_events.count
2018-03-27 19:54:05 +05:30
expect(page).to have_content "Trigger"
2020-07-28 23:09:34 +05:30
expect(page).to have_css(checkbox_selector, visible: :all, count: event_count)
2018-03-27 19:54:05 +05:30
end
end
2022-04-04 11:22:00 +05:30
context 'integrations only has one supported event' do
let(:integration_name) { 'Asana' }
2018-03-27 19:54:05 +05:30
it "doesn't show unnecessary Trigger checkboxes" do
expect(page).not_to have_content "Trigger"
2020-07-28 23:09:34 +05:30
expect(page).not_to have_css(checkbox_selector, visible: :all)
2018-03-27 19:54:05 +05:30
end
end
end