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

in_product_marketing_spec.rb « emails « mailers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e4157eaf5dcbbf4c4c355f0516832d12f3376ede (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# frozen_string_literal: true

require 'spec_helper'
require 'email_spec'

RSpec.describe Emails::InProductMarketing do
  include EmailSpec::Matchers
  include InProductMarketingHelper

  let_it_be(:user) { create(:user) }
  let_it_be(:group) { create(:group) }

  describe '#in_product_marketing_email' do
    using RSpec::Parameterized::TableSyntax

    where(:track, :series) do
      :create | 0
      :create | 1
      :create | 2
      :verify | 0
      :verify | 1
      :verify | 2
      :trial  | 0
      :trial  | 1
      :trial  | 2
      :team   | 0
      :team   | 1
      :team   | 2
    end

    with_them do
      subject { Notify.in_product_marketing_email(user.id, group.id, track, series) }

      it 'has the correct subject and content' do
        aggregate_failures do
          is_expected.to have_subject(subject_line(track, series))
          is_expected.to have_body_text(in_product_marketing_title(track, series))
          is_expected.to have_body_text(in_product_marketing_subtitle(track, series))
          is_expected.to have_body_text(in_product_marketing_cta_text(track, series))
        end
      end
    end
  end
end