spreewald 2.99.0 → 2.99.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e40a203a4efe394c63dfe3513bcbee6fd9b2c03adeb6a2da742083f8e1916db
4
- data.tar.gz: a3607b851a21bbed752f0abcb07a0f492efeb03d7bcf9dab65df2ee4049fbd30
3
+ metadata.gz: 00603bf8e54cec9e5ceab37fec65ebc1ed2e0a83b753a2eb63b7c1481470cd0b
4
+ data.tar.gz: 713310e4fd479da1786534a0c6c33769483d87b6199e47ff2fa432f9333245a2
5
5
  SHA512:
6
- metadata.gz: 44e4db7d78e098e62fde16d7c912dd761384fde5d131d3dc9b92c7ff960ef60b36e284b9aba8f125ae61c1a36ba9a05c73715b39ae36ec735e285f8eae76baef
7
- data.tar.gz: cabe0d013bdbeebd4e250ea73437e15b8de88bca1bfdb6d331fb9521ecda26d8f8fe74e7e7f8e4f150bec938c8d6099cc17823b09f7bf97650021a7cca2d9398
6
+ metadata.gz: 1ac94e470ce28516b0aa09dac529631a4208a4eb8dc8ae9959c6d8cbecc779521d74f569f5041a71a2bcd71a1a23a52b4e48a9decc991fed8e5db5e07c5a17a8
7
+ data.tar.gz: 9d66b30b3fa449c0e69f16b654ccacb4ee10349cf2eb34f328a08cf45cc5390fd73aad455d63232f75ca8df4e9e320763ef8aff39b711108d46dd553f2b2c25c
@@ -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.1
7
+
8
+ - Reintroduced support for emails with CRLF line ending
9
+
6
10
  ## 2.99.0
7
11
  - The following steps were deprecated and will be removed in the upcoming major version:
8
12
  - `/^the "([^"]*)" field should have no error$/` (see [#134](https://github.com/makandra/spreewald/issues/134))
@@ -58,7 +58,7 @@ class MailFinder
58
58
  end
59
59
 
60
60
  def email_text_body(mail, type = '')
61
- if mail.html_part && type != 'plain-text'
61
+ body = if mail.html_part && type != 'plain-text'
62
62
  dom = Nokogiri::HTML(mail.html_part.body.to_s)
63
63
  dom.at_css('body').text.gsub(/\n\n/, "\n")
64
64
  elsif mail.text_part && type != 'HTML'
@@ -66,6 +66,7 @@ class MailFinder
66
66
  else
67
67
  mail.body.to_s
68
68
  end
69
+ body.gsub("\r\n", "\n") # The mail gem (>= 2.7.1) switched from \n to \r\n line breaks (LF to CRLF) in plain text mails.
69
70
  end
70
71
 
71
72
  def show_mails(mails, only_header = false)
@@ -1,3 +1,3 @@
1
1
  module Spreewald
2
- VERSION = '2.99.0'
2
+ VERSION = '2.99.1'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (2.99.0)
4
+ spreewald (2.99.1)
5
5
  cucumber
6
6
  cucumber_priority (>= 0.3.0)
7
7
  rspec (>= 2.13.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (2.99.0)
4
+ spreewald (2.99.1)
5
5
  cucumber
6
6
  cucumber_priority (>= 0.3.0)
7
7
  rspec (>= 2.13.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (2.99.0)
4
+ spreewald (2.99.1)
5
5
  cucumber
6
6
  cucumber_priority (>= 0.3.0)
7
7
  rspec (>= 2.13.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (2.99.0)
4
+ spreewald (2.99.1)
5
5
  cucumber
6
6
  cucumber_priority (>= 0.3.0)
7
7
  rspec (>= 2.13.0)
@@ -17,7 +17,15 @@ class SpreewaldMailer < ApplicationMailer
17
17
  :subject => SUBJECT
18
18
  )
19
19
  end
20
-
20
+
21
+ def email_crlf
22
+ email
23
+ end
24
+
25
+ def email_with_umlauts
26
+ email
27
+ end
28
+
21
29
  def html_email_with_links
22
30
  email
23
31
  end
@@ -9,6 +9,16 @@ class EmailsController < ApplicationController
9
9
  render_nothing
10
10
  end
11
11
 
12
+ def send_crlf_email
13
+ deliver :email_crlf
14
+ render_nothing
15
+ end
16
+
17
+ def send_email_with_umlauts
18
+ deliver :email_with_umlauts
19
+ render_nothing
20
+ end
21
+
12
22
  def send_html_email_with_links
13
23
  deliver :html_email_with_links
14
24
  render_nothing
@@ -21,6 +21,14 @@ class Mailer < ActionMailer::Base
21
21
  )
22
22
  end
23
23
 
24
+ def email_crlf
25
+ email
26
+ end
27
+
28
+ def email_with_umlauts
29
+ email
30
+ end
31
+
24
32
  def html_email_with_links
25
33
  email
26
34
  end
@@ -42,6 +50,10 @@ class Mailer < ActionMailer::Base
42
50
  body BODY
43
51
  end
44
52
 
53
+ def email_crlf
54
+ email
55
+ end
56
+
45
57
  def html_email_with_links
46
58
  email
47
59
  end
@@ -0,0 +1,5 @@
1
+ Body
2
+ with
3
+ CRLF
4
+ line
5
+ breaks
@@ -6,6 +6,8 @@ Rails.application.routes.draw do
6
6
 
7
7
  get '/emails/do_nothing', to: 'emails#do_nothing'
8
8
  get '/emails/send_email', to: 'emails#send_email'
9
+ get '/emails/send_crlf_email', to: 'emails#send_crlf_email'
10
+ get '/emails/send_email_with_umlauts', to: 'emails#send_email_with_umlauts'
9
11
  get '/emails/send_html_email_with_links', to: 'emails#send_html_email_with_links'
10
12
  get '/emails/send_text_email_with_links', to: 'emails#send_text_email_with_links'
11
13
 
@@ -279,6 +279,41 @@ Feature: Test Spreewald's email steps
279
279
  '''
280
280
  """
281
281
 
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
+ """
282
317
 
283
318
  Scenario: /^I follow the (first|second|third)? ?link in the e?mail$/ (HTML e-mail body)
284
319
  When I go to "/emails/send_html_email_with_links"
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.0
4
+ version: 2.99.1
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-10-01 00:00:00.000000000 Z
11
+ date: 2020-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -348,6 +348,8 @@ files:
348
348
  - tests/shared/app/views/layouts/mailer.html.erb
349
349
  - tests/shared/app/views/layouts/mailer.text.erb
350
350
  - tests/shared/app/views/mailer/email.text.erb
351
+ - tests/shared/app/views/mailer/email_crlf.text.erb
352
+ - tests/shared/app/views/mailer/email_with_umlauts.text.erb
351
353
  - tests/shared/app/views/mailer/html_email_with_links.haml
352
354
  - tests/shared/app/views/mailer/text_email_with_links.text.erb
353
355
  - tests/shared/app/views/spreewald_mailer
@@ -410,7 +412,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
410
412
  - !ruby/object:Gem::Version
411
413
  version: '0'
412
414
  requirements: []
413
- rubygems_version: 3.1.2
415
+ rubygems_version: 3.0.3
414
416
  signing_key:
415
417
  specification_version: 4
416
418
  summary: Collection of useful cucumber steps.
@@ -579,6 +581,8 @@ test_files:
579
581
  - tests/shared/app/views/layouts/mailer.html.erb
580
582
  - tests/shared/app/views/layouts/mailer.text.erb
581
583
  - tests/shared/app/views/mailer/email.text.erb
584
+ - tests/shared/app/views/mailer/email_crlf.text.erb
585
+ - tests/shared/app/views/mailer/email_with_umlauts.text.erb
582
586
  - tests/shared/app/views/mailer/html_email_with_links.haml
583
587
  - tests/shared/app/views/mailer/text_email_with_links.text.erb
584
588
  - tests/shared/app/views/spreewald_mailer