email-example-spec 0.1.0
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 +7 -0
- data/CHANGELOG.md +3 -0
- data/CONTRIBUTING.md +125 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +104 -0
- data/LICENSE.md +22 -0
- data/README.md +47 -0
- data/Rakefile +16 -0
- data/email-example-spec.gemspec +17 -0
- data/lib/email-example-spec.rb +19 -0
- data/lib/email-example-spec/config.rb +8 -0
- data/lib/email-example-spec/email/content.rb +14 -0
- data/lib/email-example-spec/fixture.rb +18 -0
- data/lib/email-example-spec/rspec/match_email_example_in.rb +7 -0
- data/lib/email-example-spec/version.rb +3 -0
- data/lib/email_example_spec.rb +1 -0
- data/spec/email-example-spec/rspec/match_email_example_in_html_spec.rb +19 -0
- data/spec/email-example-spec/rspec/match_email_example_in_plain_text_spec.rb +19 -0
- data/spec/email-example-spec/rspec/match_email_example_multipart_spec.rb +20 -0
- data/spec/email-example-spec/version_spec.rb +7 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/support/fixtures/rspec/match_email_example_in/welcome_mail.html +16 -0
- data/spec/support/fixtures/rspec/match_email_example_in/welcome_mail.multipart +33 -0
- data/spec/support/fixtures/rspec/match_email_example_in/welcome_mail.txt +14 -0
- data/spec/support/templates/rspec/match_email_example_in/welcome_mail.html.erb +5 -0
- data/spec/support/templates/rspec/match_email_example_in/welcome_mail.text.erb +3 -0
- metadata +82 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2034214910583bef70d8126fb149f4f120e8d7f8
|
4
|
+
data.tar.gz: 85e8e2315c1cc6352f68a7291f559e437e8eef29
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d36467df05f67658104489fe0fbddd4a47a400d615244dde557d032125c5fedd6539227e4509d25593e3438075539b24898043130917affc9bce1612b9764603
|
7
|
+
data.tar.gz: a15fd539690da96e548ffd6498e82e9e7c08df355a6e571d43597f4ccf838e75e27b9ea499f00cd7bbd350401ae428e8abb3f77d2e2e2c3e18a36f3a440414c8
|
data/CHANGELOG.md
ADDED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
# Contributing to EmailExampleSpec
|
2
|
+
|
3
|
+
This project is work of [many contributors](https://github.com/dblock/email-example-spec/graphs/contributors).
|
4
|
+
|
5
|
+
You're encouraged to submit [pull requests](https://github.com/dblock/email-example-spec/pulls), [propose features and discuss issues](https://github.com/dblock/email-example-spec/issues).
|
6
|
+
|
7
|
+
In the examples below, substitute your Github username for `contributor` in URLs.
|
8
|
+
|
9
|
+
## Fork the Project
|
10
|
+
|
11
|
+
Fork the [project on Github](https://github.com/dblock/email-example-spec) and check out your copy.
|
12
|
+
|
13
|
+
```
|
14
|
+
git clone https://github.com/contributor/email-example-spec.git
|
15
|
+
cd email-example-spec
|
16
|
+
git remote add upstream https://github.com/dblock/email-example-spec.git
|
17
|
+
```
|
18
|
+
|
19
|
+
## Create a Topic Branch
|
20
|
+
|
21
|
+
Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.
|
22
|
+
|
23
|
+
```
|
24
|
+
git checkout master
|
25
|
+
git pull upstream master
|
26
|
+
git checkout -b my-feature-branch
|
27
|
+
```
|
28
|
+
|
29
|
+
## Bundle Install and Test
|
30
|
+
|
31
|
+
Ensure that you can build the project and run tests.
|
32
|
+
|
33
|
+
```
|
34
|
+
bundle install
|
35
|
+
bundle exec rake
|
36
|
+
```
|
37
|
+
|
38
|
+
## Write Tests
|
39
|
+
|
40
|
+
Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build.
|
41
|
+
Add to [spec](spec).
|
42
|
+
|
43
|
+
We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix.
|
44
|
+
|
45
|
+
## Write Code
|
46
|
+
|
47
|
+
Implement your feature or bug fix.
|
48
|
+
|
49
|
+
Ruby style is enforced with [Rubocop](https://github.com/bbatsov/rubocop).
|
50
|
+
Run `bundle exec rubocop` and fix any style issues highlighted.
|
51
|
+
|
52
|
+
Make sure that `bundle exec rake` completes without errors.
|
53
|
+
|
54
|
+
## Write Documentation
|
55
|
+
|
56
|
+
Document any external behavior in the [README](README.md).
|
57
|
+
|
58
|
+
## Update Changelog
|
59
|
+
|
60
|
+
Add a line to [CHANGELOG](CHANGELOG.md) under *Next Release*.
|
61
|
+
Make it look like every other line, including your name and link to your Github account.
|
62
|
+
|
63
|
+
## Commit Changes
|
64
|
+
|
65
|
+
Make sure git knows your name and email address:
|
66
|
+
|
67
|
+
```
|
68
|
+
git config --global user.name "Your Name"
|
69
|
+
git config --global user.email "contributor@example.com"
|
70
|
+
```
|
71
|
+
|
72
|
+
Writing good commit logs is important. A commit log should describe what changed and why.
|
73
|
+
|
74
|
+
```
|
75
|
+
git add ...
|
76
|
+
git commit
|
77
|
+
```
|
78
|
+
|
79
|
+
## Push
|
80
|
+
|
81
|
+
```
|
82
|
+
git push origin my-feature-branch
|
83
|
+
```
|
84
|
+
|
85
|
+
## Make a Pull Request
|
86
|
+
|
87
|
+
Go to https://github.com/contributor/grape and select your feature branch.
|
88
|
+
Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.
|
89
|
+
|
90
|
+
## Rebase
|
91
|
+
|
92
|
+
If you've been working on a change for a while, rebase with upstream/master.
|
93
|
+
|
94
|
+
```
|
95
|
+
git fetch upstream
|
96
|
+
git rebase upstream/master
|
97
|
+
git push origin my-feature-branch -f
|
98
|
+
```
|
99
|
+
|
100
|
+
## Update CHANGELOG Again
|
101
|
+
|
102
|
+
Update the [CHANGELOG](CHANGELOG.md) with the pull request number. A typical entry looks as follows.
|
103
|
+
|
104
|
+
```
|
105
|
+
* [#123](https://github.com/dblock/email-example-spec/pull/123): Reticulated splines - [@contributor](https://github.com/contributor).
|
106
|
+
```
|
107
|
+
|
108
|
+
Amend your previous commit and force push the changes.
|
109
|
+
|
110
|
+
```
|
111
|
+
git commit --amend
|
112
|
+
git push origin my-feature-branch -f
|
113
|
+
```
|
114
|
+
|
115
|
+
## Check on Your Pull Request
|
116
|
+
|
117
|
+
Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above.
|
118
|
+
|
119
|
+
## Be Patient
|
120
|
+
|
121
|
+
It's likely that your change will not be merged and that the nitpicky maintainers will ask you to do more, or fix seemingly benign problems. Hang on there!
|
122
|
+
|
123
|
+
## Thank You
|
124
|
+
|
125
|
+
Please do know that we really appreciate and value your time and work. We love you, really.
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
email-example-spec (0.1.0)
|
5
|
+
actionmailer
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actionmailer (4.2.1)
|
11
|
+
actionpack (= 4.2.1)
|
12
|
+
actionview (= 4.2.1)
|
13
|
+
activejob (= 4.2.1)
|
14
|
+
mail (~> 2.5, >= 2.5.4)
|
15
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
16
|
+
actionpack (4.2.1)
|
17
|
+
actionview (= 4.2.1)
|
18
|
+
activesupport (= 4.2.1)
|
19
|
+
rack (~> 1.6)
|
20
|
+
rack-test (~> 0.6.2)
|
21
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
22
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
23
|
+
actionview (4.2.1)
|
24
|
+
activesupport (= 4.2.1)
|
25
|
+
builder (~> 3.1)
|
26
|
+
erubis (~> 2.7.0)
|
27
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
28
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
29
|
+
activejob (4.2.1)
|
30
|
+
activesupport (= 4.2.1)
|
31
|
+
globalid (>= 0.3.0)
|
32
|
+
activesupport (4.2.1)
|
33
|
+
i18n (~> 0.7)
|
34
|
+
json (~> 1.7, >= 1.7.7)
|
35
|
+
minitest (~> 5.1)
|
36
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
37
|
+
tzinfo (~> 1.1)
|
38
|
+
ast (2.0.0)
|
39
|
+
astrolabe (1.3.0)
|
40
|
+
parser (>= 2.2.0.pre.3, < 3.0)
|
41
|
+
builder (3.2.2)
|
42
|
+
diff-lcs (1.2.5)
|
43
|
+
erubis (2.7.0)
|
44
|
+
globalid (0.3.3)
|
45
|
+
activesupport (>= 4.1.0)
|
46
|
+
i18n (0.7.0)
|
47
|
+
json (1.8.2)
|
48
|
+
loofah (2.0.1)
|
49
|
+
nokogiri (>= 1.5.9)
|
50
|
+
mail (2.6.3)
|
51
|
+
mime-types (>= 1.16, < 3)
|
52
|
+
mime-types (2.4.3)
|
53
|
+
mini_portile (0.6.2)
|
54
|
+
minitest (5.5.1)
|
55
|
+
nokogiri (1.6.6.2)
|
56
|
+
mini_portile (~> 0.6.0)
|
57
|
+
parser (2.2.0.3)
|
58
|
+
ast (>= 1.1, < 3.0)
|
59
|
+
powerpack (0.1.0)
|
60
|
+
rack (1.6.0)
|
61
|
+
rack-test (0.6.3)
|
62
|
+
rack (>= 1.0)
|
63
|
+
rails-deprecated_sanitizer (1.0.3)
|
64
|
+
activesupport (>= 4.2.0.alpha)
|
65
|
+
rails-dom-testing (1.0.6)
|
66
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
67
|
+
nokogiri (~> 1.6.0)
|
68
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
69
|
+
rails-html-sanitizer (1.0.2)
|
70
|
+
loofah (~> 2.0)
|
71
|
+
rainbow (2.0.0)
|
72
|
+
rake (10.4.2)
|
73
|
+
rspec (3.2.0)
|
74
|
+
rspec-core (~> 3.2.0)
|
75
|
+
rspec-expectations (~> 3.2.0)
|
76
|
+
rspec-mocks (~> 3.2.0)
|
77
|
+
rspec-core (3.2.3)
|
78
|
+
rspec-support (~> 3.2.0)
|
79
|
+
rspec-expectations (3.2.1)
|
80
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
81
|
+
rspec-support (~> 3.2.0)
|
82
|
+
rspec-mocks (3.2.1)
|
83
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
84
|
+
rspec-support (~> 3.2.0)
|
85
|
+
rspec-support (3.2.2)
|
86
|
+
rubocop (0.30.0)
|
87
|
+
astrolabe (~> 1.3)
|
88
|
+
parser (>= 2.2.0.1, < 3.0)
|
89
|
+
powerpack (~> 0.1)
|
90
|
+
rainbow (>= 1.99.1, < 3.0)
|
91
|
+
ruby-progressbar (~> 1.4)
|
92
|
+
ruby-progressbar (1.7.5)
|
93
|
+
thread_safe (0.3.5)
|
94
|
+
tzinfo (1.2.2)
|
95
|
+
thread_safe (~> 0.1)
|
96
|
+
|
97
|
+
PLATFORMS
|
98
|
+
ruby
|
99
|
+
|
100
|
+
DEPENDENCIES
|
101
|
+
email-example-spec!
|
102
|
+
rake (~> 10.4)
|
103
|
+
rspec (~> 3.2)
|
104
|
+
rubocop (= 0.30.0)
|
data/LICENSE.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2015 Daniel Doubrovkine, Artsy and Contributors
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
ExampleExampleSpec
|
2
|
+
==================
|
3
|
+
|
4
|
+
[](https://travis-ci.org/dblock/email-example-spec)
|
5
|
+
|
6
|
+
VCR for e-mail templates.
|
7
|
+
|
8
|
+
## Install
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'email-example-spec'
|
12
|
+
```
|
13
|
+
|
14
|
+
## Configure
|
15
|
+
|
16
|
+
Configure the root directory of your mail fixtures in *spec/spec_helper.rb*.
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
EmailExampleSpec.configure do |config|
|
20
|
+
config.record = true # record new e-mails, don't commit this!
|
21
|
+
config.fixture_path = File.join(Rails.root, 'spec/support/fixtures/emails')
|
22
|
+
end
|
23
|
+
```
|
24
|
+
|
25
|
+
## Use
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
describe WelcomeMailer do
|
29
|
+
let(:user) { User.new }
|
30
|
+
subject do
|
31
|
+
WelcomeMailer.welcome(user)
|
32
|
+
end
|
33
|
+
it 'works' do
|
34
|
+
expect(subject).to match_email_example_in 'welcome_mail.txt'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
```
|
38
|
+
|
39
|
+
## Contributing
|
40
|
+
|
41
|
+
See [CONTRIBUTING](CONTRIBUTING.md).
|
42
|
+
|
43
|
+
## Copyright and License
|
44
|
+
|
45
|
+
Copyright (c) 2015, Daniel Doubrovkine, Artsy and [Contributors](CHANGELOG.md).
|
46
|
+
|
47
|
+
This project is licensed under the [MIT License](LICENSE.md).
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
|
4
|
+
Bundler.setup :default, :development
|
5
|
+
|
6
|
+
require 'rspec/core'
|
7
|
+
require 'rspec/core/rake_task'
|
8
|
+
|
9
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
10
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'rubocop/rake_task'
|
14
|
+
RuboCop::RakeTask.new
|
15
|
+
|
16
|
+
task default: [:rubocop, :spec]
|
@@ -0,0 +1,17 @@
|
|
1
|
+
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
2
|
+
require 'email-example-spec/version'
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = 'email-example-spec'
|
6
|
+
s.version = EmailExampleSpec::VERSION
|
7
|
+
s.authors = ['Daniel Doubrovkine']
|
8
|
+
s.email = 'dblock@dblock.org'
|
9
|
+
s.platform = Gem::Platform::RUBY
|
10
|
+
s.required_rubygems_version = '>= 1.3.6'
|
11
|
+
s.files = Dir['**/*']
|
12
|
+
s.require_paths = ['lib']
|
13
|
+
s.homepage = 'http://github.com/dblock/email-example-spec'
|
14
|
+
s.licenses = ['MIT']
|
15
|
+
s.summary = 'Integration testing with e-mail examples.'
|
16
|
+
s.add_dependency 'actionmailer'
|
17
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'action_mailer'
|
2
|
+
|
3
|
+
require 'email-example-spec/version'
|
4
|
+
require 'email-example-spec/config'
|
5
|
+
require 'email-example-spec/fixture'
|
6
|
+
require 'email-example-spec/email/content'
|
7
|
+
require 'email-example-spec/rspec/match_email_example_in'
|
8
|
+
|
9
|
+
module EmailExampleSpec
|
10
|
+
class << self
|
11
|
+
def configure
|
12
|
+
block_given? ? yield(Config) : Config
|
13
|
+
end
|
14
|
+
|
15
|
+
def config
|
16
|
+
Config
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module EmailExampleSpec
|
2
|
+
module Email
|
3
|
+
module Content
|
4
|
+
def self.encoded(email)
|
5
|
+
email = email.dup
|
6
|
+
email.add_date Time.at(0).utc
|
7
|
+
email.message_id = 1
|
8
|
+
email.content_type_parameters['boundary'] = 'boundary'
|
9
|
+
email.body.boundary = 'boundary'
|
10
|
+
email.encoded
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module EmailExampleSpec
|
2
|
+
module Fixture
|
3
|
+
def self.read_or_record!(fixture, content)
|
4
|
+
fixture = File.join(EmailExampleSpec.config.fixture_path, fixture) if EmailExampleSpec.config.fixture_path
|
5
|
+
if File.exist?(fixture)
|
6
|
+
File.read(fixture)
|
7
|
+
elsif EmailExampleSpec.config.record
|
8
|
+
FileUtils.mkdir_p File.dirname(fixture)
|
9
|
+
File.open(fixture, 'wt') do |file|
|
10
|
+
file.write(content)
|
11
|
+
end
|
12
|
+
content
|
13
|
+
else
|
14
|
+
fail "missing #{fixture}"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
RSpec::Matchers.define :match_email_example_in do |expected, _options = {}|
|
2
|
+
match do |actual|
|
3
|
+
actual_content = EmailExampleSpec::Email::Content.encoded(actual)
|
4
|
+
expected_content = EmailExampleSpec::Fixture.read_or_record! expected, actual_content
|
5
|
+
actual_content == expected_content
|
6
|
+
end
|
7
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'email-example-spec'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'html' do
|
4
|
+
subject do
|
5
|
+
Class.new(ActionMailer::Base) do
|
6
|
+
default from: 'Joe User <joe@example.org>'
|
7
|
+
|
8
|
+
def welcome_mail(username)
|
9
|
+
@username = username
|
10
|
+
mail to: 'user@example.org', subject: 'Welcome!' do |format|
|
11
|
+
format.html { render 'rspec/match_email_example_in/welcome_mail' }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
it 'matches' do
|
17
|
+
expect(subject.welcome_mail('username')).to match_email_example_in 'rspec/match_email_example_in/welcome_mail.html'
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'plain text' do
|
4
|
+
subject do
|
5
|
+
Class.new(ActionMailer::Base) do
|
6
|
+
default from: 'Joe User <joe@example.org>'
|
7
|
+
|
8
|
+
def welcome_mail(username)
|
9
|
+
@username = username
|
10
|
+
mail to: 'user@example.org', subject: 'Welcome!' do |format|
|
11
|
+
format.text { render 'rspec/match_email_example_in/welcome_mail' }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
it 'matches' do
|
17
|
+
expect(subject.welcome_mail('username')).to match_email_example_in 'rspec/match_email_example_in/welcome_mail.txt'
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'multipart' do
|
4
|
+
subject do
|
5
|
+
Class.new(ActionMailer::Base) do
|
6
|
+
default from: 'Joe User <joe@example.org>'
|
7
|
+
|
8
|
+
def welcome_mail(username)
|
9
|
+
@username = username
|
10
|
+
mail to: 'user@example.org', subject: 'Welcome!' do |format|
|
11
|
+
format.html { render 'rspec/match_email_example_in/welcome_mail' }
|
12
|
+
format.text { render 'rspec/match_email_example_in/welcome_mail' }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
it 'matches' do
|
18
|
+
expect(subject.welcome_mail('username')).to match_email_example_in 'rspec/match_email_example_in/welcome_mail.multipart'
|
19
|
+
end
|
20
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'rspec'
|
5
|
+
require 'email-example-spec'
|
6
|
+
|
7
|
+
ActionMailer::Base.view_paths = File.join(File.dirname(__FILE__), 'support/templates')
|
8
|
+
|
9
|
+
EmailExampleSpec.configure do |config|
|
10
|
+
config.fixture_path = File.join(File.dirname(__FILE__), 'support/fixtures')
|
11
|
+
config.record = true
|
12
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Date: Thu, 01 Jan 1970 00:00:00 +0000
|
2
|
+
From: Joe User <joe@example.org>
|
3
|
+
To: user@example.org
|
4
|
+
Message-ID: 1
|
5
|
+
Subject: Welcome!
|
6
|
+
Mime-Version: 1.0
|
7
|
+
Content-Type: text/html;
|
8
|
+
boundary=boundary;
|
9
|
+
charset=UTF-8
|
10
|
+
Content-Transfer-Encoding: 7bit
|
11
|
+
|
12
|
+
<body>
|
13
|
+
<p>Hi username,</p>
|
14
|
+
<p>Thanks for joining our service! Please check back often.</p>
|
15
|
+
</body>
|
16
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
Date: Thu, 01 Jan 1970 00:00:00 +0000
|
2
|
+
From: Joe User <joe@example.org>
|
3
|
+
To: user@example.org
|
4
|
+
Message-ID: 1
|
5
|
+
Subject: Welcome!
|
6
|
+
Mime-Version: 1.0
|
7
|
+
Content-Type: multipart/alternative;
|
8
|
+
boundary=boundary;
|
9
|
+
charset=UTF-8
|
10
|
+
Content-Transfer-Encoding: 7bit
|
11
|
+
|
12
|
+
|
13
|
+
--boundary
|
14
|
+
Content-Type: text/plain;
|
15
|
+
charset=UTF-8
|
16
|
+
Content-Transfer-Encoding: 7bit
|
17
|
+
|
18
|
+
Hi username,
|
19
|
+
|
20
|
+
Thanks for joining our service! Please check back often.
|
21
|
+
|
22
|
+
--boundary
|
23
|
+
Content-Type: text/html;
|
24
|
+
charset=UTF-8
|
25
|
+
Content-Transfer-Encoding: 7bit
|
26
|
+
|
27
|
+
<body>
|
28
|
+
<p>Hi username,</p>
|
29
|
+
<p>Thanks for joining our service! Please check back often.</p>
|
30
|
+
</body>
|
31
|
+
|
32
|
+
|
33
|
+
--boundary--
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Date: Thu, 01 Jan 1970 00:00:00 +0000
|
2
|
+
From: Joe User <joe@example.org>
|
3
|
+
To: user@example.org
|
4
|
+
Message-ID: 1
|
5
|
+
Subject: Welcome!
|
6
|
+
Mime-Version: 1.0
|
7
|
+
Content-Type: text/plain;
|
8
|
+
boundary=boundary;
|
9
|
+
charset=UTF-8
|
10
|
+
Content-Transfer-Encoding: 7bit
|
11
|
+
|
12
|
+
Hi username,
|
13
|
+
|
14
|
+
Thanks for joining our service! Please check back often.
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: email-example-spec
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel Doubrovkine
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-04-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: actionmailer
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description:
|
28
|
+
email: dblock@dblock.org
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- CHANGELOG.md
|
34
|
+
- CONTRIBUTING.md
|
35
|
+
- Gemfile
|
36
|
+
- Gemfile.lock
|
37
|
+
- LICENSE.md
|
38
|
+
- README.md
|
39
|
+
- Rakefile
|
40
|
+
- email-example-spec.gemspec
|
41
|
+
- lib/email-example-spec.rb
|
42
|
+
- lib/email-example-spec/config.rb
|
43
|
+
- lib/email-example-spec/email/content.rb
|
44
|
+
- lib/email-example-spec/fixture.rb
|
45
|
+
- lib/email-example-spec/rspec/match_email_example_in.rb
|
46
|
+
- lib/email-example-spec/version.rb
|
47
|
+
- lib/email_example_spec.rb
|
48
|
+
- spec/email-example-spec/rspec/match_email_example_in_html_spec.rb
|
49
|
+
- spec/email-example-spec/rspec/match_email_example_in_plain_text_spec.rb
|
50
|
+
- spec/email-example-spec/rspec/match_email_example_multipart_spec.rb
|
51
|
+
- spec/email-example-spec/version_spec.rb
|
52
|
+
- spec/spec_helper.rb
|
53
|
+
- spec/support/fixtures/rspec/match_email_example_in/welcome_mail.html
|
54
|
+
- spec/support/fixtures/rspec/match_email_example_in/welcome_mail.multipart
|
55
|
+
- spec/support/fixtures/rspec/match_email_example_in/welcome_mail.txt
|
56
|
+
- spec/support/templates/rspec/match_email_example_in/welcome_mail.html.erb
|
57
|
+
- spec/support/templates/rspec/match_email_example_in/welcome_mail.text.erb
|
58
|
+
homepage: http://github.com/dblock/email-example-spec
|
59
|
+
licenses:
|
60
|
+
- MIT
|
61
|
+
metadata: {}
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.3.6
|
76
|
+
requirements: []
|
77
|
+
rubyforge_project:
|
78
|
+
rubygems_version: 2.2.2
|
79
|
+
signing_key:
|
80
|
+
specification_version: 4
|
81
|
+
summary: Integration testing with e-mail examples.
|
82
|
+
test_files: []
|