blob: a7da2e9553d2236fc0743129707cfb96a41a9c4a (
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
45
46
47
48
49
50
51
52
53
54
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Email::Message::InProductMarketing::Verify do
let_it_be(:group) { build(:group) }
let_it_be(:user) { build(:user) }
subject(:message) { described_class.new(group: group, user: user, series: series)}
describe "public methods" do
context 'with series 0' do
let(:series) { 0 }
it 'returns value for series', :aggregate_failures do
expect(message.subject_line).to be_present
expect(message.tagline).to be_present
expect(message.title).to be_present
expect(message.subtitle).to be_present
expect(message.body_line1).to be_present
expect(message.body_line2).to be_nil
expect(message.cta_text).to be_present
end
end
context 'with series 1' do
let(:series) { 1 }
it 'returns value for series', :aggregate_failures do
expect(message.subject_line).to be_present
expect(message.tagline).to be_present
expect(message.title).to be_present
expect(message.subtitle).to be_present
expect(message.body_line1).to be_present
expect(message.body_line2).to be_present
expect(message.cta_text).to be_present
end
end
context 'with series 2' do
let(:series) { 2 }
it 'returns value for series', :aggregate_failures do
expect(message.subject_line).to be_present
expect(message.tagline).to be_present
expect(message.title).to be_present
expect(message.subtitle).to be_present
expect(message.body_line1).to be_present
expect(message.body_line2).to be_nil
expect(message.cta_text).to be_present
end
end
end
end
|