spreewald 0.5.14 → 0.5.15
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/spreewald/email_steps.rb +29 -23
- data/lib/spreewald_support/version.rb +1 -1
- data/tests/rails-2.3/config/database.yml +1 -2
- data/tests/rails-3.2/config/database.yml +1 -2
- metadata +17 -19
data/Gemfile.lock
CHANGED
@@ -20,36 +20,40 @@ end
|
|
20
20
|
# Body: ...
|
21
21
|
# Attachments: ...
|
22
22
|
# """
|
23
|
-
#
|
23
|
+
#
|
24
24
|
# You can skip lines, of course.
|
25
25
|
Then /^(an|no) e?mail should have been sent with:$/ do |mode, raw_data|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
patiently do
|
27
|
+
raw_data.strip!
|
28
|
+
conditions = {}.tap do |hash|
|
29
|
+
raw_data.split("\n").each do |row|
|
30
|
+
if row.match(/^[a-z]+: /i)
|
31
|
+
key, value = row.split(": ", 2)
|
32
|
+
hash[key.downcase.to_sym] = value
|
33
|
+
end
|
32
34
|
end
|
33
35
|
end
|
36
|
+
@mail = MailFinder.find(conditions)
|
37
|
+
expectation = mode == 'no' ? 'should_not' : 'should'
|
38
|
+
@mail.send(expectation, be_present)
|
34
39
|
end
|
35
|
-
@mail = MailFinder.find(conditions)
|
36
|
-
expectation = mode == 'no' ? 'should_not' : 'should'
|
37
|
-
@mail.send(expectation, be_present)
|
38
40
|
end
|
39
41
|
|
40
42
|
# nodoc
|
41
43
|
Then /^(an|no) e?mail should have been sent((?: |and|with|from "[^"]+"|bcc "[^"]+"|to "[^"]+"|the subject "[^"]+"|the body "[^"]+"|the attachments "[^"]+")+)$/ do |mode, query|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
44
|
+
patiently do
|
45
|
+
conditions = {}
|
46
|
+
conditions[:to] = $1 if query =~ /to "([^"]+)"/
|
47
|
+
conditions[:cc] = $1 if query =~ / cc "([^"]+)"/
|
48
|
+
conditions[:bcc] = $1 if query =~ /bcc "([^"]+)"/
|
49
|
+
conditions[:from] = $1 if query =~ /from "([^"]+)"/
|
50
|
+
conditions[:subject] = $1 if query =~ /the subject "([^"]+)"/
|
51
|
+
conditions[:body] = $1 if query =~ /the body "([^"]+)"/
|
52
|
+
conditions[:attachments] = $1 if query =~ /the attachments "([^"]+)"/
|
53
|
+
@mail = MailFinder.find(conditions)
|
54
|
+
expectation = mode == 'no' ? 'should_not' : 'should'
|
55
|
+
@mail.send(expectation, be_present)
|
56
|
+
end
|
53
57
|
end
|
54
58
|
|
55
59
|
# Only works after you have retrieved the mail using "Then an email should have been sent with:"
|
@@ -88,9 +92,11 @@ end
|
|
88
92
|
# All of these lines
|
89
93
|
# need to be present
|
90
94
|
# """
|
91
|
-
Then /^that e?mail should have the following lines in the body:$/ do |body|
|
95
|
+
Then /^that e?mail should( not)? have the following lines in the body:$/ do |expectation, body|
|
96
|
+
expectation = negate ? 'should_not' : 'should'
|
97
|
+
|
92
98
|
body.to_s.strip.split(/\n/).each do |line|
|
93
|
-
@mail.body.
|
99
|
+
@mail.body.send(expectation, include(line.strip))
|
94
100
|
end
|
95
101
|
end
|
96
102
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spreewald
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 15
|
10
|
+
version: 0.5.15
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tobias Kraze
|
@@ -15,13 +15,13 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-06-
|
19
|
-
default_executable:
|
18
|
+
date: 2013-06-06 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
|
-
name: cucumber-rails
|
23
21
|
prerelease: false
|
24
|
-
|
22
|
+
name: cucumber-rails
|
23
|
+
type: :runtime
|
24
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
@@ -30,12 +30,12 @@ dependencies:
|
|
30
30
|
segments:
|
31
31
|
- 0
|
32
32
|
version: "0"
|
33
|
-
|
34
|
-
version_requirements: *id001
|
33
|
+
requirement: *id001
|
35
34
|
- !ruby/object:Gem::Dependency
|
36
|
-
name: cucumber
|
37
35
|
prerelease: false
|
38
|
-
|
36
|
+
name: cucumber
|
37
|
+
type: :runtime
|
38
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
@@ -44,12 +44,12 @@ dependencies:
|
|
44
44
|
segments:
|
45
45
|
- 0
|
46
46
|
version: "0"
|
47
|
-
|
48
|
-
version_requirements: *id002
|
47
|
+
requirement: *id002
|
49
48
|
- !ruby/object:Gem::Dependency
|
50
|
-
name: capybara
|
51
49
|
prerelease: false
|
52
|
-
|
50
|
+
name: capybara
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
53
53
|
none: false
|
54
54
|
requirements:
|
55
55
|
- - ">="
|
@@ -58,8 +58,7 @@ dependencies:
|
|
58
58
|
segments:
|
59
59
|
- 0
|
60
60
|
version: "0"
|
61
|
-
|
62
|
-
version_requirements: *id003
|
61
|
+
requirement: *id003
|
63
62
|
description: A collection of cucumber steps we use in our projects, including steps to check HTML, tables, emails and some utility methods.
|
64
63
|
email:
|
65
64
|
- tobias@kraze.eu
|
@@ -140,7 +139,6 @@ files:
|
|
140
139
|
- tests/shared/features/shared/step_definitions/test_steps.rb
|
141
140
|
- tests/shared/features/shared/tables.feature
|
142
141
|
- tests/shared/features/support/paths.rb
|
143
|
-
has_rdoc: true
|
144
142
|
homepage: https://github.com/makandra/spreewald
|
145
143
|
licenses: []
|
146
144
|
|
@@ -170,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
168
|
requirements: []
|
171
169
|
|
172
170
|
rubyforge_project:
|
173
|
-
rubygems_version: 1.
|
171
|
+
rubygems_version: 1.8.24
|
174
172
|
signing_key:
|
175
173
|
specification_version: 3
|
176
174
|
summary: Collection of useful cucumber steps.
|