capybara-mechanize 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -63,8 +63,12 @@ class Capybara::Mechanize::Browser < Capybara::RackTest::Browser
63
63
  end
64
64
  end
65
65
 
66
- def find(selector)
67
- dom.xpath(selector).map { |node| Capybara::Mechanize::Node.new(self, node) }
66
+ def find(format, selector)
67
+ if format==:css
68
+ dom.css(selector, Capybara::RackTest::CSSHandlers.new)
69
+ else
70
+ dom.xpath(selector)
71
+ end.map { |node| Capybara::Mechanize::Node.new(self, node) }
68
72
  end
69
73
 
70
74
  attr_reader :agent
@@ -1,5 +1,5 @@
1
1
  module Capybara
2
2
  module Mechanize
3
- VERSION = '1.0.2'
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
@@ -13,14 +13,14 @@ describe Capybara::Mechanize::Driver, 'local' do
13
13
  it 'should keep headers on link clicks' do
14
14
  driver = Capybara::RackTest::Driver.new(TestApp, :headers => {'HTTP_FOO' => 'foobar'})
15
15
  driver.visit('/header_links')
16
- driver.find('.//a').first.click
16
+ driver.find_xpath('.//a').first.click
17
17
  driver.html.should include('foobar')
18
18
  end
19
19
 
20
20
  it 'should keep headers on form submit' do
21
21
  driver = Capybara::RackTest::Driver.new(TestApp, :headers => {'HTTP_FOO' => 'foobar'})
22
22
  driver.visit('/header_links')
23
- driver.find('.//input').first.click
23
+ driver.find_xpath('.//input').first.click
24
24
  driver.html.should include('foobar')
25
25
  end
26
26
 
@@ -9,7 +9,8 @@ Capybara::SpecHelper.run_specs TestSessions::Mechanize, "Mechanize", :skip => [
9
9
  :screenshot,
10
10
  :frames,
11
11
  :windows,
12
- :server
12
+ :server,
13
+ :hover
13
14
  ]
14
15
 
15
16
  describe Capybara::Session do
@@ -19,7 +19,8 @@ session_describe = Capybara::SpecHelper.run_specs TestSessions::Mechanize, "Mech
19
19
  :screenshot,
20
20
  :frames,
21
21
  :windows,
22
- :server
22
+ :server,
23
+ :hover
23
24
  ]
24
25
 
25
26
  session_describe.include_context("remote tests")
data/spec/spec_helper.rb CHANGED
@@ -9,8 +9,8 @@ $LOAD_PATH << File.join(PROJECT_ROOT, 'lib')
9
9
  Dir[File.join(PROJECT_ROOT, 'spec', 'support', '**', '*.rb')].each { |file| require(file) }
10
10
 
11
11
  RSpec.configure do |config|
12
- # Spruce up the focus!
13
- config.filter_run :focus => true
12
+ # This needs to remain commented out until there is a capybara release that includes https://github.com/jnicklas/capybara/pull/1078
13
+ # config.filter_run :focus => true
14
14
  config.run_all_when_everything_filtered = true
15
15
  config.treat_symbols_as_metadata_keys_with_true_values = true
16
16
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-mechanize
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  prerelease:
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: 2013-05-07 00:00:00.000000000 Z
12
+ date: 2013-05-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mechanize
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: '2.5'
21
+ version: '2.7'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,23 +26,23 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: '2.5'
29
+ version: '2.7'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: capybara
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - '='
35
+ - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: 2.0.2
37
+ version: 2.1.0
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - '='
43
+ - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: 2.0.2
45
+ version: 2.1.0
46
46
  description: RackTest driver for Capybara, but with remote request support thanks
47
47
  to mechanize
48
48
  email: jeroen@jeevidee.nl