Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-12 00:09:40 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-12 00:09:40 +0300
commit213f46f188c29e9c442df61530110e172a7e819e (patch)
tree8544300e523c4e8cc3955406fa58e2d4b8ded773 /spec/mailers
parent33f7ef81fd6bcab7bbdf0bc3f37d337256fb11fb (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/mailers')
-rw-r--r--spec/mailers/emails/imports_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/mailers/emails/imports_spec.rb b/spec/mailers/emails/imports_spec.rb
new file mode 100644
index 00000000000..039113d3098
--- /dev/null
+++ b/spec/mailers/emails/imports_spec.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require 'email_spec'
+
+RSpec.describe Emails::Imports, feature_category: :importers do
+ include EmailSpec::Matchers
+
+ let(:errors) { { 'gist_id1' => "Title can't be blank", 'gist_id2' => 'Snippet maximum file count exceeded' } }
+ let(:user) { build_stubbed(:user) }
+
+ describe '#github_gists_import_errors_email' do
+ subject { Notify.github_gists_import_errors_email('user_id', errors) }
+
+ before do
+ allow(User).to receive(:find).and_return(user)
+ end
+
+ it 'sends success email' do
+ expect(subject).to have_subject('GitHub Gists import finished with errors')
+ expect(subject).to have_content('GitHub gists that were not imported:')
+ expect(subject).to have_content("Gist with id gist_id1 failed due to error: Title can't be blank.")
+ expect(subject).to have_content('Gist with id gist_id2 failed due to error: Snippet maximum file count exceeded.')
+ end
+
+ it_behaves_like 'appearance header and footer enabled'
+ it_behaves_like 'appearance header and footer not enabled'
+ end
+end