spreewald 2.99.1 → 2.99.2

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: 00603bf8e54cec9e5ceab37fec65ebc1ed2e0a83b753a2eb63b7c1481470cd0b
4
- data.tar.gz: 713310e4fd479da1786534a0c6c33769483d87b6199e47ff2fa432f9333245a2
3
+ metadata.gz: 04e59902ff7a473603ddb7619f350b34de83072a81e36afc5767480e837c4345
4
+ data.tar.gz: 5dfc9a6630cc0332228024528a55025f7d672140bd0acabbffecbafbcd18188c
5
5
  SHA512:
6
- metadata.gz: 1ac94e470ce28516b0aa09dac529631a4208a4eb8dc8ae9959c6d8cbecc779521d74f569f5041a71a2bcd71a1a23a52b4e48a9decc991fed8e5db5e07c5a17a8
7
- data.tar.gz: 9d66b30b3fa449c0e69f16b654ccacb4ee10349cf2eb34f328a08cf45cc5390fd73aad455d63232f75ca8df4e9e320763ef8aff39b711108d46dd553f2b2c25c
6
+ metadata.gz: 21eed3d8dab955f4da45fa3a30fda49c1d3f6ca2b462736cb4e171725a7c685f6e6149a1a261646028fcb1310fb9a070e68679426a670d77271d3c2e2926ca58
7
+ data.tar.gz: 299c23ccc3f6f751b850e0d776da679c6f2c4480cb1e150ff655cc31aaaffd33008f592b5b3d53a4f9bae543391ec75943f42805949b5be690f1d383a25bfed4
@@ -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.2
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
  ## 2.99.1
7
11
 
8
12
  - Reintroduced support for emails with CRLF line ending
@@ -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 = '2.99.1'
2
+ VERSION = '2.99.2'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (2.99.1)
4
+ spreewald (2.99.2)
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.1)
4
+ spreewald (2.99.2)
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.1)
4
+ spreewald (2.99.2)
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.1)
4
+ spreewald (2.99.2)
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'
@@ -315,6 +315,23 @@ Feature: Test Spreewald's email steps
315
315
  '''
316
316
  """
317
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
+
318
335
  Scenario: /^I follow the (first|second|third)? ?link in the e?mail$/ (HTML e-mail body)
319
336
  When I go to "/emails/send_html_email_with_links"
320
337
  And I follow the first link in the email
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spreewald
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.99.1
4
+ version: 2.99.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kraze
@@ -350,6 +350,7 @@ files:
350
350
  - tests/shared/app/views/mailer/email.text.erb
351
351
  - tests/shared/app/views/mailer/email_crlf.text.erb
352
352
  - tests/shared/app/views/mailer/email_with_umlauts.text.erb
353
+ - tests/shared/app/views/mailer/html_email_with_linebreaks.html
353
354
  - tests/shared/app/views/mailer/html_email_with_links.haml
354
355
  - tests/shared/app/views/mailer/text_email_with_links.text.erb
355
356
  - tests/shared/app/views/spreewald_mailer
@@ -583,6 +584,7 @@ test_files:
583
584
  - tests/shared/app/views/mailer/email.text.erb
584
585
  - tests/shared/app/views/mailer/email_crlf.text.erb
585
586
  - tests/shared/app/views/mailer/email_with_umlauts.text.erb
587
+ - tests/shared/app/views/mailer/html_email_with_linebreaks.html
586
588
  - tests/shared/app/views/mailer/html_email_with_links.haml
587
589
  - tests/shared/app/views/mailer/text_email_with_links.text.erb
588
590
  - tests/shared/app/views/spreewald_mailer