diff options
Diffstat (limited to 'spec/lib/gitlab/email')
4 files changed, 11 insertions, 15 deletions
diff --git a/spec/lib/gitlab/email/handler/create_issue_handler_spec.rb b/spec/lib/gitlab/email/handler/create_issue_handler_spec.rb index 8ff8de2379a..369d7e994d2 100644 --- a/spec/lib/gitlab/email/handler/create_issue_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/create_issue_handler_spec.rb @@ -116,7 +116,7 @@ RSpec.describe Gitlab::Email::Handler::CreateIssueHandler do context "when the issue could not be saved" do before do allow_any_instance_of(Issue).to receive(:persisted?).and_return(false) - allow_any_instance_of(Issue).to receive(:ensure_metrics).and_return(nil) + allow_any_instance_of(Issue).to receive(:ensure_metrics!).and_return(nil) end it "raises an InvalidIssueError" do diff --git a/spec/lib/gitlab/email/html_to_markdown_parser_spec.rb b/spec/lib/gitlab/email/html_to_markdown_parser_spec.rb index fe585d47d59..59c488739dc 100644 --- a/spec/lib/gitlab/email/html_to_markdown_parser_spec.rb +++ b/spec/lib/gitlab/email/html_to_markdown_parser_spec.rb @@ -1,17 +1,21 @@ # frozen_string_literal: true -require 'spec_helper' +require 'kramdown' +require 'html2text' +require 'fast_spec_helper' +require 'support/helpers/fixture_helpers' RSpec.describe Gitlab::Email::HtmlToMarkdownParser, feature_category: :service_desk do + include FixtureHelpers + subject { described_class.convert(html) } describe '.convert' do let(:html) { fixture_file("lib/gitlab/email/basic.html") } it 'parses html correctly' do - expect(subject) - .to eq( - <<-BODY.strip_heredoc.chomp + expect(subject).to eq( + <<~BODY.chomp Hello, World! This is some e-mail content. Even though it has whitespace and newlines, the e-mail converter will handle it correctly. *Even* mismatched tags. diff --git a/spec/lib/gitlab/email/message/build_ios_app_guide_spec.rb b/spec/lib/gitlab/email/message/build_ios_app_guide_spec.rb index 3089f955252..4b77b2f7192 100644 --- a/spec/lib/gitlab/email/message/build_ios_app_guide_spec.rb +++ b/spec/lib/gitlab/email/message/build_ios_app_guide_spec.rb @@ -2,13 +2,9 @@ require 'spec_helper' -RSpec.describe Gitlab::Email::Message::BuildIosAppGuide do +RSpec.describe Gitlab::Email::Message::BuildIosAppGuide, :saas do subject(:message) { described_class.new } - before do - allow(Gitlab).to receive(:com?) { true } - end - it 'contains the correct message', :aggregate_failures do expect(message.subject_line).to eq 'Get set up to build for iOS' expect(message.title).to eq "Building for iOS? We've got you covered." diff --git a/spec/lib/gitlab/email/message/in_product_marketing/helper_spec.rb b/spec/lib/gitlab/email/message/in_product_marketing/helper_spec.rb index 3c0d83d0f9e..a3c2d1b428e 100644 --- a/spec/lib/gitlab/email/message/in_product_marketing/helper_spec.rb +++ b/spec/lib/gitlab/email/message/in_product_marketing/helper_spec.rb @@ -27,11 +27,7 @@ RSpec.describe Gitlab::Email::Message::InProductMarketing::Helper do subject(:class_with_helper) { dummy_class_with_helper.new(format) } - context 'gitlab.com' do - before do - allow(Gitlab).to receive(:com?) { true } - end - + context 'for SaaS', :saas do context 'format is HTML' do it 'returns the correct HTML' do message = "If you no longer wish to receive marketing emails from us, " \ |