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

41 lines
1 KiB
Ruby
Raw Normal View History

2019-07-07 11:18:12 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
require 'spec_helper'
2020-06-23 00:09:42 +05:30
RSpec.describe 'User activates HipChat', :js do
2020-04-22 19:07:51 +05:30
include_context 'project service activation'
2018-03-17 18:26:18 +05:30
2020-11-24 15:15:51 +05:30
context 'with standard settings' do
2020-04-22 19:07:51 +05:30
before do
stub_request(:post, /.*api.hipchat.com.*/)
end
2018-03-17 18:26:18 +05:30
it 'activates service' do
2020-04-22 19:07:51 +05:30
visit_project_integration('HipChat')
2018-03-17 18:26:18 +05:30
fill_in('Room', with: 'gitlab')
fill_in('Token', with: 'verySecret')
2020-04-22 19:07:51 +05:30
2020-11-24 15:15:51 +05:30
click_test_then_save_integration(expect_test_to_fail: false)
2018-03-17 18:26:18 +05:30
2020-11-24 15:15:51 +05:30
expect(page).to have_content('HipChat settings saved and active.')
2018-03-17 18:26:18 +05:30
end
end
context 'with custom settings' do
2020-04-22 19:07:51 +05:30
before do
stub_request(:post, /.*chat.example.com.*/)
end
2018-03-17 18:26:18 +05:30
it 'activates service' do
2020-04-22 19:07:51 +05:30
visit_project_integration('HipChat')
2018-03-17 18:26:18 +05:30
fill_in('Room', with: 'gitlab_custom')
fill_in('Token', with: 'secretCustom')
fill_in('Server', with: 'https://chat.example.com')
2020-04-22 19:07:51 +05:30
2020-11-24 15:15:51 +05:30
click_test_then_save_integration(expect_test_to_fail: false)
2018-03-17 18:26:18 +05:30
2020-11-24 15:15:51 +05:30
expect(page).to have_content('HipChat settings saved and active.')
2018-03-17 18:26:18 +05:30
end
end
end