2019-07-07 11:18:12 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
# HipchatService is partially removed and it will be remove completely
|
|
|
|
# after the deletion of all the database records.
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab/-/issues/27954
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe HipchatService do
|
2021-06-08 01:23:25 +05:30
|
|
|
let_it_be(:project) { create(:project) }
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
subject(:service) { described_class.new(project: project) }
|
2016-06-02 11:05:42 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
it { is_expected.to be_valid }
|
2016-06-02 11:05:42 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
describe '#to_param' do
|
|
|
|
subject { service.to_param }
|
2016-06-02 11:05:42 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
it { is_expected.to eq('hipchat') }
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
describe '#supported_events' do
|
|
|
|
subject { service.supported_events }
|
2015-12-23 02:04:40 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
it { is_expected.to be_empty }
|
|
|
|
end
|
2016-09-13 17:45:13 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
describe '#save' do
|
|
|
|
it 'prevents records from being created or updated' do
|
|
|
|
expect(service.save).to be_falsey
|
2016-09-13 17:45:13 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
expect(service.errors.full_messages).to include(
|
|
|
|
'HipChat endpoint is deprecated and should not be created or modified.'
|
|
|
|
)
|
2015-09-11 14:41:01 +05:30
|
|
|
end
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
end
|