|
45 | 45 | end
|
46 | 46 | end
|
47 | 47 |
|
| 48 | +shared_examples 'an email with X-GitLab headers containing IDs' do |
| 49 | + it 'has X-GitLab-*-ID header' do |
| 50 | + is_expected.to have_header "X-GitLab-#{model.class.name}-ID", "#{model.id}" |
| 51 | + end |
| 52 | + |
| 53 | + it 'has X-GitLab-*-IID header if model has iid defined' do |
| 54 | + if model.respond_to?(:iid) |
| 55 | + is_expected.to have_header "X-GitLab-#{model.class.name}-IID", "#{model.iid}" |
| 56 | + else |
| 57 | + expect(subject.header["X-GitLab-#{model.class.name}-IID"]).to eq nil |
| 58 | + end |
| 59 | + end |
| 60 | +end |
| 61 | + |
48 | 62 | shared_examples 'an email with X-GitLab headers containing project details' do
|
49 | 63 | it 'has X-GitLab-Project headers' do
|
50 | 64 | aggregate_failures do
|
|
69 | 83 |
|
70 | 84 | shared_examples 'a thread answer email with reply-by-email enabled' do
|
71 | 85 | include_examples 'an email with X-GitLab headers containing project details'
|
| 86 | + include_examples 'an email with X-GitLab headers containing IDs' |
72 | 87 |
|
73 | 88 | it 'has the characteristics of a threaded reply' do
|
74 | 89 | host = Gitlab.config.gitlab.host
|
|
85 | 100 |
|
86 | 101 | shared_examples 'an email starting a new thread with reply-by-email enabled' do
|
87 | 102 | include_examples 'an email with X-GitLab headers containing project details'
|
| 103 | + include_examples 'an email with X-GitLab headers containing IDs' |
88 | 104 | include_examples 'a new thread email with reply-by-email enabled'
|
89 | 105 |
|
90 | 106 | it 'includes "Reply to this email directly or <View it on GitLab>"' do
|
|
109 | 125 |
|
110 | 126 | shared_examples 'an answer to an existing thread with reply-by-email enabled' do
|
111 | 127 | include_examples 'an email with X-GitLab headers containing project details'
|
| 128 | + include_examples 'an email with X-GitLab headers containing IDs' |
112 | 129 | include_examples 'a thread answer email with reply-by-email enabled'
|
113 | 130 |
|
114 | 131 | context 'when reply-by-email is enabled with incoming address with %{key}' do
|
|
0 commit comments