lookout-rack-test 1.3.0 → 2.0.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 +9 -9
- data/lib/lookout/rack/test/rspec.rb +0 -1
- data/lib/lookout/rack/test/version.rb +1 -1
- data/lookout-rack-test.gemspec +1 -5
- metadata +7 -52
- data/lib/lookout/rack/test/rspec/email_helpers.rb +0 -32
- data/spec/email_helpers_spec.rb +0 -104
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWQ4NDI3M2VmODI1YTdhOGEyMDM4Yjc4MmQxMGJkNzg4ZmFkMGI3YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
7
|
-
|
6
|
+
NTc4NWI3YmIyMTJmOWMyZjdiZjY1MmZkZGY1YzU0ZDlhNzA0OTk1ZA==
|
7
|
+
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjRkNWE5MGRmZmVjMGVkZGNhY2M4YjI3Y2M2Y2NlMzBhZjQ0Mzg2ZjdmYzBi
|
10
|
+
ZTEyZDc4YjgzZDlhYTQxMTIzYzE4ODFkNDNiM2E1MWM5OGE1MWI4MTBkMzEy
|
11
|
+
MDE4ODlhNTNkZWNiYTVhMzg0ZWUwMGExNjdhNmMwZWFhNWJmNTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODBmOTQ4MzNkMjI0Mzk5MmU0MDIwOGU2OWZkNTE0ZmJlYjg4MzkyOTE2N2M5
|
14
|
+
MTk4OGNlNGYxZTUwODJkNDY3MTQ3MmZhYjBlMzVmZWUwMTE5MTQ0OWI5N2Rh
|
15
|
+
ODhiZmE4NDU4ZmFlZTY0NDdmMzRmNWMxMjQ3ZDM1ZjA1NTQ5MTA=
|
data/lookout-rack-test.gemspec
CHANGED
@@ -33,11 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
# Used to assist with scaffolded data and generating random data
|
34
34
|
spec.add_dependency 'factory_girl'
|
35
35
|
spec.add_dependency 'cucumber'
|
36
|
+
spec.add_dependency 'parallel_tests'
|
36
37
|
|
37
38
|
spec.add_dependency 'capybara', '~> 2.x'
|
38
|
-
spec.add_dependency 'sauce-connect'
|
39
|
-
spec.add_dependency 'sauce', '~> 3.0'
|
40
|
-
spec.add_dependency 'sauce-cucumber', '~> 3.0'
|
41
|
-
|
42
|
-
spec.add_dependency 'mercury-messages'
|
43
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lookout-rack-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -165,21 +165,7 @@ dependencies:
|
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
-
requirements:
|
171
|
-
- - ~>
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: 2.x
|
174
|
-
type: :runtime
|
175
|
-
prerelease: false
|
176
|
-
version_requirements: !ruby/object:Gem::Requirement
|
177
|
-
requirements:
|
178
|
-
- - ~>
|
179
|
-
- !ruby/object:Gem::Version
|
180
|
-
version: 2.x
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: sauce-connect
|
168
|
+
name: parallel_tests
|
183
169
|
requirement: !ruby/object:Gem::Requirement
|
184
170
|
requirements:
|
185
171
|
- - ! '>='
|
@@ -193,47 +179,19 @@ dependencies:
|
|
193
179
|
- !ruby/object:Gem::Version
|
194
180
|
version: '0'
|
195
181
|
- !ruby/object:Gem::Dependency
|
196
|
-
name:
|
197
|
-
requirement: !ruby/object:Gem::Requirement
|
198
|
-
requirements:
|
199
|
-
- - ~>
|
200
|
-
- !ruby/object:Gem::Version
|
201
|
-
version: '3.0'
|
202
|
-
type: :runtime
|
203
|
-
prerelease: false
|
204
|
-
version_requirements: !ruby/object:Gem::Requirement
|
205
|
-
requirements:
|
206
|
-
- - ~>
|
207
|
-
- !ruby/object:Gem::Version
|
208
|
-
version: '3.0'
|
209
|
-
- !ruby/object:Gem::Dependency
|
210
|
-
name: sauce-cucumber
|
182
|
+
name: capybara
|
211
183
|
requirement: !ruby/object:Gem::Requirement
|
212
184
|
requirements:
|
213
185
|
- - ~>
|
214
186
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
187
|
+
version: 2.x
|
216
188
|
type: :runtime
|
217
189
|
prerelease: false
|
218
190
|
version_requirements: !ruby/object:Gem::Requirement
|
219
191
|
requirements:
|
220
192
|
- - ~>
|
221
193
|
- !ruby/object:Gem::Version
|
222
|
-
version:
|
223
|
-
- !ruby/object:Gem::Dependency
|
224
|
-
name: mercury-messages
|
225
|
-
requirement: !ruby/object:Gem::Requirement
|
226
|
-
requirements:
|
227
|
-
- - ! '>='
|
228
|
-
- !ruby/object:Gem::Version
|
229
|
-
version: '0'
|
230
|
-
type: :runtime
|
231
|
-
prerelease: false
|
232
|
-
version_requirements: !ruby/object:Gem::Requirement
|
233
|
-
requirements:
|
234
|
-
- - ! '>='
|
235
|
-
- !ruby/object:Gem::Version
|
236
|
-
version: '0'
|
194
|
+
version: 2.x
|
237
195
|
description: RSpec and Cucumber helpers
|
238
196
|
email:
|
239
197
|
- ian.smith@lookout.com
|
@@ -272,13 +230,11 @@ files:
|
|
272
230
|
- lib/lookout/rack/test/rake/cucumber.rake
|
273
231
|
- lib/lookout/rack/test/rake/rspec.rake
|
274
232
|
- lib/lookout/rack/test/rspec.rb
|
275
|
-
- lib/lookout/rack/test/rspec/email_helpers.rb
|
276
233
|
- lib/lookout/rack/test/rspec/fake_request.rb
|
277
234
|
- lib/lookout/rack/test/rspec/model_examples.rb
|
278
235
|
- lib/lookout/rack/test/rspec/route_helper.rb
|
279
236
|
- lib/lookout/rack/test/version.rb
|
280
237
|
- lookout-rack-test.gemspec
|
281
|
-
- spec/email_helpers_spec.rb
|
282
238
|
- spec/model_examples_spec.rb
|
283
239
|
- spec/setup_spec.rb
|
284
240
|
- spec/spec_helper.rb
|
@@ -302,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
302
258
|
version: '0'
|
303
259
|
requirements: []
|
304
260
|
rubyforge_project:
|
305
|
-
rubygems_version: 2.
|
261
|
+
rubygems_version: 2.2.2
|
306
262
|
signing_key:
|
307
263
|
specification_version: 4
|
308
264
|
summary: ''
|
@@ -319,7 +275,6 @@ test_files:
|
|
319
275
|
- features/step_definitions/timefreeze_steps.rb
|
320
276
|
- features/support/env.rb
|
321
277
|
- features/timefreeze.feature
|
322
|
-
- spec/email_helpers_spec.rb
|
323
278
|
- spec/model_examples_spec.rb
|
324
279
|
- spec/setup_spec.rb
|
325
280
|
- spec/spec_helper.rb
|
@@ -1,32 +0,0 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
require 'set'
|
3
|
-
require 'mercury-messages'
|
4
|
-
|
5
|
-
module Lookout::Rack::Test::RSpec
|
6
|
-
module Emails
|
7
|
-
def expect_emails(expected_email_names)
|
8
|
-
email_names = []
|
9
|
-
Mercury::Messages::SendImmediateBatchEmail.stub(:new) do |mail_hash|
|
10
|
-
email_names << mail_hash[:email_name]
|
11
|
-
end
|
12
|
-
|
13
|
-
yield
|
14
|
-
|
15
|
-
expect(Set.new(email_names)).to eql Set.new(expected_email_names)
|
16
|
-
end
|
17
|
-
|
18
|
-
def expect_email_attributes(expected_attributes)
|
19
|
-
attributes = []
|
20
|
-
Mercury::Messages::SendImmediateBatchEmail.stub(:new) do |mail_hash|
|
21
|
-
# Get all the keys (attributes) for each of this Message's pieces
|
22
|
-
attributes += mail_hash[:pieces].map{|h| h[:attributes]}.map(&:keys)
|
23
|
-
end
|
24
|
-
|
25
|
-
yield
|
26
|
-
|
27
|
-
attributes.flatten!
|
28
|
-
|
29
|
-
expect(Set.new(attributes)).to eql Set.new(expected_attributes)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
data/spec/email_helpers_spec.rb
DELETED
@@ -1,104 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
require 'lookout/rack/test/rspec/email_helpers'
|
4
|
-
include Lookout::Rack::Test::RSpec::Emails
|
5
|
-
|
6
|
-
describe 'expect_emails' do
|
7
|
-
let(:expected_email_name) { 'foo' }
|
8
|
-
let(:unexpected_email_name) { 'bar' }
|
9
|
-
|
10
|
-
it 'If I create a Mercury::Message with the expected email_name, it should pass' do
|
11
|
-
expect do
|
12
|
-
expect_emails([expected_email_name]) do
|
13
|
-
Mercury::Messages::SendImmediateBatchEmail.new(:email_name => expected_email_name)
|
14
|
-
end
|
15
|
-
end.not_to raise_error
|
16
|
-
end
|
17
|
-
|
18
|
-
it 'If I create a Mercury::Message with the expected email_name, plus some other email(s), it should fail' do
|
19
|
-
expect do
|
20
|
-
expect_emails([expected_email_name]) do
|
21
|
-
Mercury::Messages::SendImmediateBatchEmail.new(:email_name => expected_email_name)
|
22
|
-
Mercury::Messages::SendImmediateBatchEmail.new(:email_name => unexpected_email_name)
|
23
|
-
end
|
24
|
-
end.to raise_error(ExpectationNotMetError)
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'If I create a Mercury::Message with an unexpected email_name, it should fail' do
|
28
|
-
expect do
|
29
|
-
expect_emails([expected_email_name]) do
|
30
|
-
Mercury::Messages::SendImmediateBatchEmail.new(:email_name => unexpected_email_name)
|
31
|
-
end
|
32
|
-
end.to raise_error(ExpectationNotMetError)
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'If I do not create any Mercury::Message, it should fail' do
|
36
|
-
expect do
|
37
|
-
expect_emails([expected_email_name]) do
|
38
|
-
end
|
39
|
-
end.to raise_error(ExpectationNotMetError)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
class Array
|
44
|
-
# Create a hash with a key for each element in the array
|
45
|
-
def to_hash
|
46
|
-
hash = {}
|
47
|
-
self.each {|elt| hash[elt] = nil}
|
48
|
-
|
49
|
-
return hash
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def expect_email_attributes_helper(expected_attrs, actual_attrs)
|
54
|
-
expect_email_attributes(expected_attrs) do
|
55
|
-
Mercury::Messages::SendImmediateBatchEmail.new(:email_name => '',
|
56
|
-
:pieces => [{:attributes => actual_attrs.to_hash}])
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
describe 'expect_email_attributes' do
|
61
|
-
let(:expected_email_attributes) { ['foo', 'bar'] }
|
62
|
-
let(:unexpected_email_attributes) { ['baz', 'quux'] }
|
63
|
-
|
64
|
-
context 'if I create a Mercury::Message with all of - and only - the expected attributes' do
|
65
|
-
let(:actual_attrs) { expected_email_attributes.to_hash }
|
66
|
-
|
67
|
-
it 'should pass' do
|
68
|
-
expect { expect_email_attributes_helper(expected_email_attributes, actual_attrs) }.not_to raise_error
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
context 'if I create a Mercury::Message without all of the expected attributes' do
|
73
|
-
let(:actual_attrs) { [expected_email_attributes.first].to_hash }
|
74
|
-
|
75
|
-
it 'should fail' do
|
76
|
-
expect { expect_email_attributes_helper(expected_email_attributes, actual_attrs) }.to raise_error(ExpectationNotMetError)
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
context 'if I create a Mercury::Message with all of the expected attributes, plus some others' do
|
81
|
-
let(:actual_attrs) { [expected_email_attributes + unexpected_email_attributes].to_hash }
|
82
|
-
|
83
|
-
it 'should fail' do
|
84
|
-
expect { expect_email_attributes_helper(expected_email_attributes, actual_attrs) }.to raise_error(ExpectationNotMetError)
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
context 'if I create a Mercury::Message with unexpected attributes' do
|
89
|
-
let(:actual_attrs) { unexpected_email_attributes.to_hash }
|
90
|
-
|
91
|
-
it 'should fail' do
|
92
|
-
expect { expect_email_attributes_helper(expected_email_attributes, actual_attrs) }.to raise_error(ExpectationNotMetError)
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
context 'if I do not create a Mercury::Message' do
|
97
|
-
it 'it should fail' do
|
98
|
-
expect do
|
99
|
-
expect_email_attributes(expected_email_attributes) do
|
100
|
-
end
|
101
|
-
end.to raise_error(ExpectationNotMetError)
|
102
|
-
end
|
103
|
-
end
|
104
|
-
end
|