capybara-email 2.1.3 → 2.2.0

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
  SHA1:
3
- metadata.gz: 94910c296f4b4f11155068345705ff99d7c20636
4
- data.tar.gz: ab2a18a231da27c3bdeef68ae1a68a376df6e63f
3
+ metadata.gz: 1334373fa11089d316b395332b772b1fcf85f445
4
+ data.tar.gz: ce0f1ac2ce263ef8bd142672874c383f2b5d01dd
5
5
  SHA512:
6
- metadata.gz: 270f915121dc1c0d486bd8482bd2c5d5facc6edeb2f8a9ba947280d7993e8e38e9f28bed476bdbddea57a11ffe72218a61245d651ff067f9c7f8d1c41b3ed3c4
7
- data.tar.gz: a85826fc50720b507ebea25d3edbc8073512107f4d11042df0fabfa6faf3b9dde49d1abe98ae341d62d9e6ab968ca882bafd22307fdd41e6c62b70611423052b
6
+ metadata.gz: d35e28dc8d8152f9b0b30b12daf6594d162d90b73b311ed1b8ef315489a31e679318fd445b356808998ec4a77b0f8664a99fd58059e5e88f09238f87dbf838f7
7
+ data.tar.gz: 18208a068c0ef83df7e06015173099403dd3d36b8458d184ac9ee33a26487da8470bac1965e45338834edd61114bf499449182c34a30d28bff6925cee5ab572b
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build Status](https://secure.travis-ci.org/dockyard/capybara-email.png?branch=master)](http://travis-ci.org/dockyard/capybara-email)
4
4
  [![Dependency Status](https://gemnasium.com/dockyard/capybara-email.png?travis)](https://gemnasium.com/dockyard/capybara-email)
5
- [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/dockyard/capybara-email)
5
+ [![Code Climate](https://d3s6mut3hikguw.cloudfront.net/github/dockyard/capybara-email.png)](https://codeclimate.com/github/dockyard/capybara-email)
6
6
 
7
7
  Easily test [ActionMailer](https://github.com/rails/rails/tree/master/actionmailer) and [Mail](https://github.com/mikel/mail) messages in your Capybara integration tests
8
8
 
@@ -90,10 +90,16 @@ end
90
90
 
91
91
  ### Test::Unit ###
92
92
 
93
+ Require `capybara/email` at the top of `test/test_helper.rb`
94
+
95
+ ```ruby
96
+ require 'capybara/email'
97
+ ```
98
+
93
99
  Include `Capybara::Email::DSL` in your test class
94
100
 
95
101
  ```ruby
96
- class ActionController::IntegrationTest
102
+ class ActionDispatch::IntegrationTest
97
103
  include Capybara::Email::DSL
98
104
  end
99
105
  ```
@@ -128,6 +134,18 @@ class EmailTriggerControllerTest < ActionController::IntegrationTest
128
134
  end
129
135
  ```
130
136
 
137
+ ## Sending Emails with JavaScript ##
138
+ Sending emails asynchronously will cause `#open_email` to not open the
139
+ correct email or not find any email at all depending on the state of the
140
+ email queue. We recommend forcing a sleep prior to trying to read any
141
+ email after an asynchronous event:
142
+
143
+ ```ruby
144
+ click_link 'Send email'
145
+ sleep 0.1
146
+ open_email 'test@example.com'
147
+ ```
148
+
131
149
  ## Authors ##
132
150
 
133
151
  [Brian Cardarella](http://twitter.com/bcardarella)
@@ -75,7 +75,7 @@ class Capybara::Email::Driver < Capybara::Driver::Base
75
75
  #
76
76
  # @return String
77
77
  def raw
78
- if email.mime_type =~ /\Amultipart\/(alternative|related)\Z/
78
+ if email.mime_type =~ /\Amultipart\/(alternative|related|mixed)\Z/
79
79
  if email.html_part
80
80
  return email.html_part.body.to_s
81
81
  elsif email.text_part
@@ -1,5 +1,5 @@
1
1
  module Capybara
2
2
  module Email
3
- VERSION = '2.1.3'
3
+ VERSION = '2.2.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-email
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Cardarella
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-28 00:00:00.000000000 Z
11
+ date: 2013-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  requirements: []
132
132
  rubyforge_project:
133
- rubygems_version: 2.0.3
133
+ rubygems_version: 2.1.5
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: Test your ActionMailer and Mailer messages in Capybara