puffing-billy 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +10 -9
- data/lib/billy.rb +7 -0
- data/lib/billy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44bd0fde2cbcc88437c9485b627b7a7c663036aa
|
4
|
+
data.tar.gz: 3568098fec618acceb6c26a8eb9791d79dbe7933
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb89785eee28a5663d13f83f3dc4e1eb337ecdd5e9ae6823cd3be3f9eed14ddb44c9b05762ce97bb927c2a50d2f71696b806111ebb48a20849fde3cca6425370
|
7
|
+
data.tar.gz: d4ce0f9d90c921c82c3313ef2e7495a28d934217778678013a4c608ec7c8027e72dbed468013e3caf155b2c0154faad9caa7d007f731385ad32cf869534e1349
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -46,13 +46,14 @@ Or install it yourself as:
|
|
46
46
|
|
47
47
|
## RSpec Usage
|
48
48
|
|
49
|
-
In your `
|
49
|
+
In your `rails_helper.rb`:
|
50
50
|
|
51
51
|
```ruby
|
52
52
|
require 'billy/rspec'
|
53
53
|
|
54
54
|
# select a driver for your chosen browser environment
|
55
|
-
Capybara.javascript_driver = :selenium_billy
|
55
|
+
Capybara.javascript_driver = :selenium_billy # Uses Firefox
|
56
|
+
# Capybara.javascript_driver = :selenium_chrome_billy
|
56
57
|
# Capybara.javascript_driver = :webkit_billy
|
57
58
|
# Capybara.javascript_driver = :poltergeist_billy
|
58
59
|
```
|
@@ -151,7 +152,7 @@ By default, all requests to localhost or 127.0.0.1 will not be cached. If
|
|
151
152
|
you're running your test server with a different hostname, you'll need to
|
152
153
|
add that host to puffing-billy's whitelist.
|
153
154
|
|
154
|
-
In your `
|
155
|
+
In your `rails_helper.rb`:
|
155
156
|
|
156
157
|
```ruby
|
157
158
|
Billy.configure do |c|
|
@@ -162,7 +163,7 @@ end
|
|
162
163
|
If you would like to cache other local rack apps, you must whitelist only the
|
163
164
|
specific port for the application that is executing tests. If you are using
|
164
165
|
[Capybara](https://github.com/jnicklas/capybara), this can be accomplished by
|
165
|
-
adding this in your `
|
166
|
+
adding this in your `rails_helper.rb`:
|
166
167
|
|
167
168
|
```ruby
|
168
169
|
server = Capybara.current_session.server
|
@@ -278,7 +279,7 @@ context 'with a cache scope' do
|
|
278
279
|
end
|
279
280
|
|
280
281
|
# Remember to set the cache scope back to the default in an after block
|
281
|
-
# within the context it is used, and/or at the global
|
282
|
+
# within the context it is used, and/or at the global rails_helper level!
|
282
283
|
after do
|
283
284
|
proxy.cache.use_default_scope
|
284
285
|
end
|
@@ -340,7 +341,7 @@ to see how Billy's default drivers are configured.
|
|
340
341
|
|
341
342
|
## Working with VCR and Webmock
|
342
343
|
If you use VCR and Webmock elsewhere in your specs, you may need to disable them
|
343
|
-
for your specs utilizing Puffing Billy. To do so, you can configure your `
|
344
|
+
for your specs utilizing Puffing Billy. To do so, you can configure your `rails_helper.rb`
|
344
345
|
as shown below:
|
345
346
|
|
346
347
|
```ruby
|
@@ -355,9 +356,9 @@ end
|
|
355
356
|
|
356
357
|
## Resources
|
357
358
|
|
358
|
-
[Bring Ruby VCR to Javascript testing with Capybara and puffing-billy](http://architects.dzone.com/articles/bring-ruby-vcr-javascript)
|
359
|
-
[Integration Testing Stripe.js With Mocked Network Requests](http://dev.contractual.ly/testing-stripe-js-with-mocked-network/)
|
360
|
-
[Clean-up unused cache files periodically with this config](https://github.com/oesmith/puffing-billy/pull/26#issuecomment-29905030)
|
359
|
+
* [Bring Ruby VCR to Javascript testing with Capybara and puffing-billy](http://architects.dzone.com/articles/bring-ruby-vcr-javascript)
|
360
|
+
* [Integration Testing Stripe.js With Mocked Network Requests](http://dev.contractual.ly/testing-stripe-js-with-mocked-network/)
|
361
|
+
* [Clean-up unused cache files periodically with this config](https://github.com/oesmith/puffing-billy/pull/26#issuecomment-29905030)
|
361
362
|
|
362
363
|
## FAQ
|
363
364
|
|
data/lib/billy.rb
CHANGED
@@ -59,6 +59,13 @@ module Billy
|
|
59
59
|
ssl: "#{Billy.proxy.host}:#{Billy.proxy.port}")
|
60
60
|
Capybara::Selenium::Driver.new(app, profile: profile)
|
61
61
|
end
|
62
|
+
|
63
|
+
Capybara.register_driver :selenium_chrome_billy do |app|
|
64
|
+
Capybara::Selenium::Driver.new(
|
65
|
+
app, browser: :chrome,
|
66
|
+
switches: ["--proxy-server=#{Billy.proxy.host}:#{Billy.proxy.port}"]
|
67
|
+
)
|
68
|
+
end
|
62
69
|
end
|
63
70
|
end
|
64
71
|
end
|
data/lib/billy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puffing-billy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olly Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|