spreewald 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 64749212dae1262a16bb92a588740444cf7ede78c5980fbdf15f66271a4b081d
4
- data.tar.gz: 7384baaed65e17289ff4d4c52874e1c257b315b0e9026fac51bbea9a414f4141
3
+ metadata.gz: e94fff73b1219c20c1140b38f45de5a44e57da77eed6ef8fd9107c157a075c37
4
+ data.tar.gz: 0b9dab763d05e9e248c25d3e8cecb1b6493116dfd96e5c6a5c12e9a52ee417ec
5
5
  SHA512:
6
- metadata.gz: e06ba20e5252696bd8ce7aecb6f3a6f9f21eb16c3e2f7ba2cb6223bdfdfdf1cb05c34ada79e06bcd94631ea7288e802fab3f9cce98f8d59d34f7b0b9117300c3
7
- data.tar.gz: d09e69ad26c4e76a09bfaa44989bcd870b1eb160de410be081bf0d40889e3a7ffc901e02c7e208538e8c92719752a3cb7fa396a9f7dada600c257dcbcf72fef3
6
+ metadata.gz: 8abca9273d361112be92fecbd993efe99664baf70cb30af7a8be91d006fa89cfa9492a89d3b066a9824adde47439dda412ead601e51cd5006bbf8fd3d7185fb0
7
+ data.tar.gz: ce43a7c95abf0bc13b21baa1b23b7c14fbe05e10a7ad705efc1debb03bd7c18251d2b8acfaae38e9882d2f34278d9b8fb96860c1ba2795baf16c6d3a38fa8c7e
@@ -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
+ ## 3.0.1
7
+
8
+ - Fix deduplication of linebreaks for html mails in mail finder. (see issue [#153](https://github.com/makandra/spreewald/issues/153))
9
+
6
10
  ## 3.0.0
7
11
 
8
12
  ### Breaking changes
@@ -60,7 +60,7 @@ class MailFinder
60
60
  def email_text_body(mail, type = '')
61
61
  body = if mail.html_part && type != 'plain-text'
62
62
  dom = Nokogiri::HTML(mail.html_part.body.to_s)
63
- dom.at_css('body').text.gsub(/\n\n/, "\n")
63
+ dom.at_css('body').text.gsub(/[\r\n]+/, "\n")
64
64
  elsif mail.text_part && type != 'HTML'
65
65
  mail.text_part.body.to_s
66
66
  else
@@ -1,3 +1,3 @@
1
1
  module Spreewald
2
- VERSION = '3.0.0'
2
+ VERSION = '3.0.1'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (3.0.0)
4
+ spreewald (3.0.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 (3.0.0)
4
+ spreewald (3.0.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 (3.0.0)
4
+ spreewald (3.0.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 (3.0.0)
4
+ spreewald (3.0.1)
5
5
  cucumber
6
6
  cucumber_priority (>= 0.3.0)
7
7
  rspec (>= 2.13.0)
@@ -34,5 +34,9 @@ class SpreewaldMailer < ApplicationMailer
34
34
  email
35
35
  end
36
36
 
37
+ def html_email_with_linebreaks
38
+ email
39
+ end
40
+
37
41
  end
38
42
 
@@ -29,6 +29,11 @@ class EmailsController < ApplicationController
29
29
  render_nothing
30
30
  end
31
31
 
32
+ def send_html_email_with_linebreaks
33
+ deliver :html_email_with_linebreaks
34
+ render_nothing
35
+ end
36
+
32
37
  private
33
38
 
34
39
  def deliver(method_name)
@@ -37,6 +37,10 @@ class Mailer < ActionMailer::Base
37
37
  email
38
38
  end
39
39
 
40
+ def html_email_with_linebreaks
41
+ email
42
+ end
43
+
40
44
  else
41
45
 
42
46
  def email
@@ -0,0 +1,6 @@
1
+ <p>
2
+ Hello!
3
+ </p>
4
+ <p>
5
+ Bye!
6
+ </p>
@@ -10,6 +10,7 @@ Rails.application.routes.draw do
10
10
  get '/emails/send_email_with_umlauts', to: 'emails#send_email_with_umlauts'
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
+ get '/emails/send_html_email_with_linebreaks', to: 'emails#send_html_email_with_linebreaks'
13
14
 
14
15
  get '/forms/checkbox_form', to: 'forms#checkbox_form'
15
16
  get '/forms/disabled_elements', to: 'forms#disabled_elements'
@@ -269,6 +269,23 @@ Feature: Test Spreewald's email steps
269
269
  '''
270
270
  """
271
271
 
272
+ When I clear my emails
273
+ And I go to "/emails/send_html_email_with_linebreaks"
274
+
275
+ Then the following multiline step should succeed:
276
+ """
277
+ Then an email should have been sent with:
278
+ '''
279
+ From: from@example.com
280
+ Reply-To: reply-to@example.com
281
+ To: to@example.com
282
+ Subject: SUBJECT
283
+
284
+ Hello!
285
+ Bye!
286
+ '''
287
+ """
288
+
272
289
  Scenario: /^I follow the (first|second|third)? ?link in the e?mail$/ (HTML e-mail body)
273
290
  When I go to "/emails/send_html_email_with_links"
274
291
  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: 3.0.0
4
+ version: 3.0.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,7 @@ files:
348
348
  - tests/shared/app/views/mailer/email.text.erb
349
349
  - tests/shared/app/views/mailer/email_crlf.text.erb
350
350
  - tests/shared/app/views/mailer/email_with_umlauts.text.erb
351
+ - tests/shared/app/views/mailer/html_email_with_linebreaks.html
351
352
  - tests/shared/app/views/mailer/html_email_with_links.haml
352
353
  - tests/shared/app/views/mailer/text_email_with_links.text.erb
353
354
  - tests/shared/app/views/spreewald_mailer
@@ -410,7 +411,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
410
411
  - !ruby/object:Gem::Version
411
412
  version: '0'
412
413
  requirements: []
413
- rubygems_version: 3.1.2
414
+ rubygems_version: 3.0.3
414
415
  signing_key:
415
416
  specification_version: 4
416
417
  summary: Collection of useful cucumber steps.
@@ -581,6 +582,7 @@ test_files:
581
582
  - tests/shared/app/views/mailer/email.text.erb
582
583
  - tests/shared/app/views/mailer/email_crlf.text.erb
583
584
  - tests/shared/app/views/mailer/email_with_umlauts.text.erb
585
+ - tests/shared/app/views/mailer/html_email_with_linebreaks.html
584
586
  - tests/shared/app/views/mailer/html_email_with_links.haml
585
587
  - tests/shared/app/views/mailer/text_email_with_links.text.erb
586
588
  - tests/shared/app/views/spreewald_mailer