diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-12-06 15:59:03 -0200 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-12-15 15:32:49 -0200 |
commit | a5ccaded656fb215f1f8d503b88c8f28bf90ce68 (patch) | |
tree | f68c114323f6d345a753f0062c1633449e76db21 /spec/models | |
parent | 141faaacf9119ce5d765efe73c6509030ba078cd (diff) | |
download | gitlab-ce-a5ccaded656fb215f1f8d503b88c8f28bf90ce68.tar.gz |
Change SlackService to SlackNotificationsServiceissue_22269_fix_eeissue_22269
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/project_services/chat_notification_service_spec.rb | 12 | ||||
-rw-r--r-- | spec/models/project_services/chat_service_spec.rb | 11 | ||||
-rw-r--r-- | spec/models/project_services/mattermost_notification_service_spec.rb (renamed from spec/models/project_services/slack_service_spec.rb) | 2 | ||||
-rw-r--r-- | spec/models/project_services/slack_notification_service_spec.rb (renamed from spec/models/project_services/mattermost_service_spec.rb) | 2 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 4 |
5 files changed, 25 insertions, 6 deletions
diff --git a/spec/models/project_services/chat_notification_service_spec.rb b/spec/models/project_services/chat_notification_service_spec.rb new file mode 100644 index 00000000000..b4fb1cd9ed9 --- /dev/null +++ b/spec/models/project_services/chat_notification_service_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +describe ChatNotificationService, models: true do + describe "Associations" do + + before do + allow(subject).to receive(:activated?).and_return(true) + end + + it { is_expected.to validate_presence_of :webhook } + end +end diff --git a/spec/models/project_services/chat_service_spec.rb b/spec/models/project_services/chat_service_spec.rb index e6314a43501..c6a45a3e1be 100644 --- a/spec/models/project_services/chat_service_spec.rb +++ b/spec/models/project_services/chat_service_spec.rb @@ -2,7 +2,14 @@ require 'spec_helper' describe ChatService, models: true do describe "Associations" do - before { allow(subject).to receive(:activated?).and_return(true) } - it { is_expected.to validate_presence_of :webhook } + it { is_expected.to have_many :chat_names } + end + + describe '#valid_token?' do + subject { described_class.new } + + it 'is false as it has no token' do + expect(subject.valid_token?('wer')).to be_falsey + end end end diff --git a/spec/models/project_services/slack_service_spec.rb b/spec/models/project_services/mattermost_notification_service_spec.rb index 4928391fd7e..c01e64b4c8e 100644 --- a/spec/models/project_services/slack_service_spec.rb +++ b/spec/models/project_services/mattermost_notification_service_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe SlackService, models: true do +describe MattermostNotificationService, models: true do it_behaves_like "slack or mattermost" end diff --git a/spec/models/project_services/mattermost_service_spec.rb b/spec/models/project_services/slack_notification_service_spec.rb index 1e5b4c715c3..59ddddf7454 100644 --- a/spec/models/project_services/mattermost_service_spec.rb +++ b/spec/models/project_services/slack_notification_service_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe MattermostService, models: true do +describe SlackNotificationService, models: true do it_behaves_like "slack or mattermost" end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 1d8e42202ea..bab3c3dbb02 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -22,8 +22,8 @@ describe Project, models: true do it { is_expected.to have_many(:protected_branches).dependent(:destroy) } it { is_expected.to have_many(:chat_services) } it { is_expected.to have_one(:forked_project_link).dependent(:destroy) } - it { is_expected.to have_one(:slack_service).dependent(:destroy) } - it { is_expected.to have_one(:mattermost_service).dependent(:destroy) } + it { is_expected.to have_one(:slack_notification_service).dependent(:destroy) } + it { is_expected.to have_one(:mattermost_notification_service).dependent(:destroy) } it { is_expected.to have_one(:pushover_service).dependent(:destroy) } it { is_expected.to have_one(:asana_service).dependent(:destroy) } it { is_expected.to have_many(:boards).dependent(:destroy) } |