capybara-json 0.3.0.beta1 → 0.3.0.beta2

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.
@@ -1,3 +1,6 @@
1
+ ## 0.3.0.beta2
2
+ * Fix #8
3
+
1
4
  ## 0.3.0.beta1
2
5
  * Capybara 2.x support, but test not working now... (thanks to gkellogg)
3
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0.beta1
1
+ 0.3.0.beta2
@@ -29,9 +29,11 @@ class Capybara::HTTPClientJson::Driver < Capybara::Json::Driver::Base
29
29
  response.code
30
30
  end
31
31
 
32
- def source
32
+ def raw_json
33
33
  response.body
34
34
  end
35
+ alias source raw_json # almost deprecated
36
+ alias html raw_json # hack for capybara2
35
37
 
36
38
  def body
37
39
  MultiJson.load(source) || {}
@@ -30,6 +30,12 @@ module Capybara
30
30
  DEF
31
31
  end
32
32
 
33
+ %w[ raw_json json ].each do |method|
34
+ define_method(method) do
35
+ page.driver.__send__(method)
36
+ end
37
+ end
38
+
33
39
  autoload :Error, 'capybara/json/error'
34
40
 
35
41
  module Driver
@@ -3,7 +3,7 @@ module Capybara::Json::Driver
3
3
  %w[ get post put delete get! post! put! delete!
4
4
  reset!
5
5
  current_url
6
- source body response_headers status_code
6
+ raw_json json source body response_headers status_code
7
7
  ].each do |method|
8
8
  define_method(method) do
9
9
  raise NotImplementedError
@@ -55,9 +55,11 @@ class Capybara::RackTestJson::Driver < Capybara::Json::Driver::Base
55
55
  last_request.url
56
56
  end
57
57
 
58
- def source
58
+ def raw_json
59
59
  last_response.body
60
60
  end
61
+ alias source raw_json # almost deprecated
62
+ alias html raw_json # hack for capybara2
61
63
 
62
64
  def body
63
65
  MultiJson.load(source) || {}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.beta1
4
+ version: 0.3.0.beta2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-06 00:00:00.000000000 Z
12
+ date: 2013-01-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capybara