diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/projects/import_export/test_project_export.tar.gz | bin | 681774 -> 679415 bytes | |||
-rw-r--r-- | spec/features/projects/services/slack_service_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/import_export/all_models.yml | 4 | ||||
-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 |
8 files changed, 29 insertions, 10 deletions
diff --git a/spec/features/projects/import_export/test_project_export.tar.gz b/spec/features/projects/import_export/test_project_export.tar.gz Binary files differindex bfe59bdb90e..d3165d07d7b 100644 --- a/spec/features/projects/import_export/test_project_export.tar.gz +++ b/spec/features/projects/import_export/test_project_export.tar.gz diff --git a/spec/features/projects/services/slack_service_spec.rb b/spec/features/projects/services/slack_service_spec.rb index 16541f51d98..320ed13a01d 100644 --- a/spec/features/projects/services/slack_service_spec.rb +++ b/spec/features/projects/services/slack_service_spec.rb @@ -2,8 +2,8 @@ require 'spec_helper' feature 'Projects > Slack service > Setup events', feature: true do let(:user) { create(:user) } - let(:service) { SlackService.new } - let(:project) { create(:project, slack_service: service) } + let(:service) { SlackNotificationService.new } + let(:project) { create(:project, slack_notification_service: service) } background do service.fields diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index 068137f6255..9b49d6837c3 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -136,8 +136,8 @@ project: - assembla_service - asana_service - gemnasium_service -- slack_service -- mattermost_service +- slack_notification_service +- mattermost_notification_service - buildkite_service - bamboo_service - teamcity_service 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) } |