spreewald 2.99.2 → 2.99.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/spreewald_support/mail_finder.rb +1 -0
- data/lib/spreewald_support/version.rb +1 -1
- data/tests/rails-3_capybara-1/Gemfile.lock +1 -1
- data/tests/rails-3_capybara-2/Gemfile.lock +1 -1
- data/tests/rails-4_capybara-3/Gemfile.lock +1 -1
- data/tests/rails-6_capybara-3/Gemfile.lock +1 -1
- data/tests/rails-6_capybara-3/app/mailers/spreewald_mailer.rb +8 -0
- data/tests/shared/app/controllers/emails_controller.rb +10 -0
- data/tests/shared/app/models/mailer.rb +16 -0
- data/tests/shared/app/views/mailer/html_email_with_specific_line.haml +11 -0
- data/tests/shared/app/views/mailer/text_email_with_specific_line.text.erb +5 -0
- data/tests/shared/config/routes.rb +2 -0
- data/tests/shared/features/shared/email_steps.feature +94 -54
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71f40dbc5a327e21940b95c4a4a9b1946e0c30b2090e3f46e927b81f3f44a18b
|
4
|
+
data.tar.gz: c464bee9033caa6ae2b32984058aa0e37128483a2aa299780e60297b5c81b7d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a927120e6558399206bbd0c97e08c7410f7af5e700b1756daa091e961f9407c237509496791d4dc8f58a7c3e74ab3b78a6b97bca2b1bffa1dc1824ebf999a040
|
7
|
+
data.tar.gz: 12964e9c67396df967c29d1fa3925b6e01f0d0ba747ed016d15fa1cbee2c02e8b71173f6cf57e953cec9ad0d3df7dba6caf71d253e54739e3444c1b22687c2ef
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
5
5
|
|
6
|
+
## 2.99.3
|
7
|
+
- Introduce wildcard for the beginning of a line. (see issue #155)
|
8
|
+
- This will allow you to check for a specific sentence inside the body
|
9
|
+
|
6
10
|
## 2.99.2
|
7
11
|
|
8
12
|
- Fix deduplication of linebreaks for html mails in mail finder. (see issue [#153](https://github.com/makandra/spreewald/issues/153))
|
@@ -87,6 +87,7 @@ class MailFinder
|
|
87
87
|
expected = '\A\n' + Regexp.quote(expected_body.strip) + '\n\Z'
|
88
88
|
expected.gsub! '\n\*\n', '\n[\s\S]*\n'
|
89
89
|
expected.gsub! '\*\n', '.*\n'
|
90
|
+
expected.gsub! '\n\*', '\n.*'
|
90
91
|
|
91
92
|
expected.gsub! '\A\n', '\A'
|
92
93
|
expected.gsub! '\n\Z', '' # Change '' to '\Z' to force that the whole body matches
|
@@ -34,6 +34,16 @@ class EmailsController < ApplicationController
|
|
34
34
|
render_nothing
|
35
35
|
end
|
36
36
|
|
37
|
+
def send_html_email_with_specific_line
|
38
|
+
deliver :html_email_with_specific_line
|
39
|
+
render_nothing
|
40
|
+
end
|
41
|
+
|
42
|
+
def send_text_email_with_specific_line
|
43
|
+
deliver :text_email_with_specific_line
|
44
|
+
render_nothing
|
45
|
+
end
|
46
|
+
|
37
47
|
private
|
38
48
|
|
39
49
|
def deliver(method_name)
|
@@ -41,6 +41,14 @@ class Mailer < ActionMailer::Base
|
|
41
41
|
email
|
42
42
|
end
|
43
43
|
|
44
|
+
def html_email_with_specific_line
|
45
|
+
email
|
46
|
+
end
|
47
|
+
|
48
|
+
def text_email_with_specific_line
|
49
|
+
email
|
50
|
+
end
|
51
|
+
|
44
52
|
else
|
45
53
|
|
46
54
|
def email
|
@@ -66,6 +74,14 @@ class Mailer < ActionMailer::Base
|
|
66
74
|
email
|
67
75
|
end
|
68
76
|
|
77
|
+
def html_email_with_specific_line
|
78
|
+
email
|
79
|
+
end
|
80
|
+
|
81
|
+
def text_email_with_specific_line
|
82
|
+
email
|
83
|
+
end
|
84
|
+
|
69
85
|
end
|
70
86
|
|
71
87
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
!!!
|
2
|
+
%html(lang="en" xmlns="http://www.w3.org/1999/xhtml")
|
3
|
+
%body
|
4
|
+
%p
|
5
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
6
|
+
|
7
|
+
%p
|
8
|
+
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. VERY IMPORTANT SENTENCE. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
|
9
|
+
|
10
|
+
%p
|
11
|
+
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
|
@@ -0,0 +1,5 @@
|
|
1
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
2
|
+
|
3
|
+
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. VERY IMPORTANT SENTENCE. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
|
4
|
+
|
5
|
+
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
|
@@ -11,6 +11,8 @@ Rails.application.routes.draw do
|
|
11
11
|
get '/emails/send_html_email_with_links', to: 'emails#send_html_email_with_links'
|
12
12
|
get '/emails/send_text_email_with_links', to: 'emails#send_text_email_with_links'
|
13
13
|
get '/emails/send_html_email_with_linebreaks', to: 'emails#send_html_email_with_linebreaks'
|
14
|
+
get '/emails/send_html_email_with_specific_line', to: 'emails#send_html_email_with_specific_line'
|
15
|
+
get '/emails/send_text_email_with_specific_line', to: 'emails#send_text_email_with_specific_line'
|
14
16
|
|
15
17
|
get '/forms/checkbox_form', to: 'forms#checkbox_form'
|
16
18
|
get '/forms/disabled_elements', to: 'forms#disabled_elements'
|
@@ -130,6 +130,7 @@ Feature: Test Spreewald's email steps
|
|
130
130
|
breaks
|
131
131
|
'''
|
132
132
|
"""
|
133
|
+
|
133
134
|
# Test with incorrect To header
|
134
135
|
Then the following multiline step should fail:
|
135
136
|
"""
|
@@ -211,12 +212,104 @@ Feature: Test Spreewald's email steps
|
|
211
212
|
Subject: SUBJECT
|
212
213
|
|
213
214
|
Body
|
214
|
-
*
|
215
|
+
t*e
|
215
216
|
line
|
216
217
|
break
|
217
218
|
'''
|
218
219
|
"""
|
219
220
|
|
221
|
+
When I clear my emails
|
222
|
+
And I go to "/emails/send_crlf_email"
|
223
|
+
|
224
|
+
Then the following multiline step should succeed:
|
225
|
+
"""
|
226
|
+
Then an email should have been sent with:
|
227
|
+
'''
|
228
|
+
From: from@example.com
|
229
|
+
Reply-To: reply-to@example.com
|
230
|
+
To: to@example.com
|
231
|
+
Subject: SUBJECT
|
232
|
+
|
233
|
+
Body
|
234
|
+
with
|
235
|
+
CRLF
|
236
|
+
line
|
237
|
+
breaks
|
238
|
+
'''
|
239
|
+
"""
|
240
|
+
|
241
|
+
When I clear my emails
|
242
|
+
And I go to "/emails/send_email_with_umlauts"
|
243
|
+
|
244
|
+
Then the following multiline step should succeed:
|
245
|
+
"""
|
246
|
+
Then an email should have been sent with:
|
247
|
+
'''
|
248
|
+
From: from@example.com
|
249
|
+
Reply-To: reply-to@example.com
|
250
|
+
To: to@example.com
|
251
|
+
Subject: SUBJECT
|
252
|
+
|
253
|
+
Viele Grüße
|
254
|
+
'''
|
255
|
+
"""
|
256
|
+
|
257
|
+
When I clear my emails
|
258
|
+
And I go to "/emails/send_html_email_with_linebreaks"
|
259
|
+
|
260
|
+
Then the following multiline step should succeed:
|
261
|
+
"""
|
262
|
+
Then an email should have been sent with:
|
263
|
+
'''
|
264
|
+
From: from@example.com
|
265
|
+
Reply-To: reply-to@example.com
|
266
|
+
To: to@example.com
|
267
|
+
Subject: SUBJECT
|
268
|
+
|
269
|
+
Hello!
|
270
|
+
Bye!
|
271
|
+
'''
|
272
|
+
"""
|
273
|
+
|
274
|
+
# Test body with wildcard at the begin of a line
|
275
|
+
When I clear my emails
|
276
|
+
And I go to "/emails/send_html_email_with_specific_line"
|
277
|
+
|
278
|
+
Then the following multiline step should succeed:
|
279
|
+
"""
|
280
|
+
Then an email should have been sent with:
|
281
|
+
'''
|
282
|
+
From: from@example.com
|
283
|
+
Reply-To: reply-to@example.com
|
284
|
+
To: to@example.com
|
285
|
+
Subject: SUBJECT
|
286
|
+
|
287
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr*
|
288
|
+
*VERY IMPORTANT SENTENCE*
|
289
|
+
Ut wisi enim ad minim veniam*
|
290
|
+
'''
|
291
|
+
"""
|
292
|
+
|
293
|
+
When I clear my emails
|
294
|
+
And I go to "/emails/send_text_email_with_specific_line"
|
295
|
+
|
296
|
+
Then the following multiline step should succeed:
|
297
|
+
"""
|
298
|
+
Then an email should have been sent with:
|
299
|
+
'''
|
300
|
+
From: from@example.com
|
301
|
+
Reply-To: reply-to@example.com
|
302
|
+
To: to@example.com
|
303
|
+
Subject: SUBJECT
|
304
|
+
|
305
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr*
|
306
|
+
|
307
|
+
*VERY IMPORTANT SENTENCE*
|
308
|
+
|
309
|
+
Ut wisi enim ad minim veniam*
|
310
|
+
'''
|
311
|
+
"""
|
312
|
+
|
220
313
|
Scenario: Scenario: /^(an|no) e?mail should have been sent((?: |and|with|from "[^"]+"|bcc "[^"]+"|cc "[^"]+"|to "[^"]+"|the subject "[^"]+"|the body "[^"]+"|the attachments "[^"]+")+)$/
|
221
314
|
When I go to "/emails/send_email"
|
222
315
|
|
@@ -279,59 +372,6 @@ Feature: Test Spreewald's email steps
|
|
279
372
|
'''
|
280
373
|
"""
|
281
374
|
|
282
|
-
When I clear my emails
|
283
|
-
And I go to "/emails/send_crlf_email"
|
284
|
-
|
285
|
-
Then the following multiline step should succeed:
|
286
|
-
"""
|
287
|
-
Then an email should have been sent with:
|
288
|
-
'''
|
289
|
-
From: from@example.com
|
290
|
-
Reply-To: reply-to@example.com
|
291
|
-
To: to@example.com
|
292
|
-
Subject: SUBJECT
|
293
|
-
|
294
|
-
Body
|
295
|
-
with
|
296
|
-
CRLF
|
297
|
-
line
|
298
|
-
breaks
|
299
|
-
'''
|
300
|
-
"""
|
301
|
-
|
302
|
-
When I clear my emails
|
303
|
-
And I go to "/emails/send_email_with_umlauts"
|
304
|
-
|
305
|
-
Then the following multiline step should succeed:
|
306
|
-
"""
|
307
|
-
Then an email should have been sent with:
|
308
|
-
'''
|
309
|
-
From: from@example.com
|
310
|
-
Reply-To: reply-to@example.com
|
311
|
-
To: to@example.com
|
312
|
-
Subject: SUBJECT
|
313
|
-
|
314
|
-
Viele Grüße
|
315
|
-
'''
|
316
|
-
"""
|
317
|
-
|
318
|
-
When I clear my emails
|
319
|
-
And I go to "/emails/send_html_email_with_linebreaks"
|
320
|
-
|
321
|
-
Then the following multiline step should succeed:
|
322
|
-
"""
|
323
|
-
Then an email should have been sent with:
|
324
|
-
'''
|
325
|
-
From: from@example.com
|
326
|
-
Reply-To: reply-to@example.com
|
327
|
-
To: to@example.com
|
328
|
-
Subject: SUBJECT
|
329
|
-
|
330
|
-
Hello!
|
331
|
-
Bye!
|
332
|
-
'''
|
333
|
-
"""
|
334
|
-
|
335
375
|
Scenario: /^I follow the (first|second|third)? ?link in the e?mail$/ (HTML e-mail body)
|
336
376
|
When I go to "/emails/send_html_email_with_links"
|
337
377
|
And I follow the first link in the email
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spreewald
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.99.
|
4
|
+
version: 2.99.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Kraze
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -352,7 +352,9 @@ files:
|
|
352
352
|
- tests/shared/app/views/mailer/email_with_umlauts.text.erb
|
353
353
|
- tests/shared/app/views/mailer/html_email_with_linebreaks.html
|
354
354
|
- tests/shared/app/views/mailer/html_email_with_links.haml
|
355
|
+
- tests/shared/app/views/mailer/html_email_with_specific_line.haml
|
355
356
|
- tests/shared/app/views/mailer/text_email_with_links.text.erb
|
357
|
+
- tests/shared/app/views/mailer/text_email_with_specific_line.text.erb
|
356
358
|
- tests/shared/app/views/spreewald_mailer
|
357
359
|
- tests/shared/app/views/static_pages/click_on.html.haml
|
358
360
|
- tests/shared/app/views/static_pages/home.html.haml
|
@@ -413,7 +415,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
413
415
|
- !ruby/object:Gem::Version
|
414
416
|
version: '0'
|
415
417
|
requirements: []
|
416
|
-
rubygems_version: 3.
|
418
|
+
rubygems_version: 3.1.2
|
417
419
|
signing_key:
|
418
420
|
specification_version: 4
|
419
421
|
summary: Collection of useful cucumber steps.
|
@@ -586,7 +588,9 @@ test_files:
|
|
586
588
|
- tests/shared/app/views/mailer/email_with_umlauts.text.erb
|
587
589
|
- tests/shared/app/views/mailer/html_email_with_linebreaks.html
|
588
590
|
- tests/shared/app/views/mailer/html_email_with_links.haml
|
591
|
+
- tests/shared/app/views/mailer/html_email_with_specific_line.haml
|
589
592
|
- tests/shared/app/views/mailer/text_email_with_links.text.erb
|
593
|
+
- tests/shared/app/views/mailer/text_email_with_specific_line.text.erb
|
590
594
|
- tests/shared/app/views/spreewald_mailer
|
591
595
|
- tests/shared/app/views/static_pages/click_on.html.haml
|
592
596
|
- tests/shared/app/views/static_pages/home.html.haml
|