capybara 3.11.0 → 3.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c349d493d1d6639b40265451f5b357aa7b5d29d279e1095284071fba9bc8a59
4
- data.tar.gz: 23350dd400ffd3e11fdda081f12331ab7518b94061fb104355e30cfbee0d9935
3
+ metadata.gz: 54ee49a77f4b1cec2ed59869334766af110a64a50dae8cdc02a95b5ba750fb9b
4
+ data.tar.gz: db2319b75d0626c01babc298eccd8ce76d3da65a8a0a994bb25de5c742e1721f
5
5
  SHA512:
6
- metadata.gz: caa9124c0465dcc82b15109c4cbd841dbc8e214ff87fd928a712abd6896155c6c8b3be00d0ec09cb1fbbea9da8206773b799766da5fd08ac9bc0a9d36d81dd85
7
- data.tar.gz: 18b0c515e7be809183bc26d6d2ce38692561e30760b96a26992d44b96027484ae942f7c25e48b803323ef0534ca616fd20c503ec2cfefbf1da47416eb30b2443
6
+ metadata.gz: d9c1965b9ba0d38813d3060aaefe797ef8d6610416c954bf4cebdae70de5ca23bc4b07303033ecbf2f5e62bc681319c6b20dc0567f49e89ccc02df38dd10d44d
7
+ data.tar.gz: bf971abb444f58438091422e656108d29bb7efa0d2f2dfb1728a818626cea38e7fa700b3701904ca10344a4f272e14fd99482c23b62b9cfe3b6139d868fa5b30
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ # Version 3.11.1
2
+ Release date: 2018-11-16
3
+
4
+ ###Fixed
5
+
6
+ * Fixed :link_or_button XPath generation when it has had an expression filter added
7
+
1
8
  # Version 3.11.0
2
9
  Release date: 2018-11-14
3
10
 
@@ -161,11 +161,9 @@ Capybara.add_selector(:button) do
161
161
  image_btn_xpath = image_btn_xpath[alt_matches]
162
162
  end
163
163
 
164
- res_xpath = input_btn_xpath.union(btn_xpath).union(image_btn_xpath)
165
-
166
- res_xpath = expression_filters.keys.inject(res_xpath) { |memo, ef| memo[find_by_attr(ef, options[ef])] }
167
-
168
- res_xpath
164
+ %i[value title type].inject(input_btn_xpath.union(btn_xpath).union(image_btn_xpath)) do |memo, ef|
165
+ memo[find_by_attr(ef, options[ef])]
166
+ end
169
167
  end
170
168
 
171
169
  node_filter(:disabled, :boolean, default: false, skip_if: :all) { |node, value| !(value ^ node.disabled?) }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Capybara
4
- VERSION = '3.11.0'
4
+ VERSION = '3.11.1'
5
5
  end
@@ -416,6 +416,22 @@ RSpec.describe Capybara do
416
416
  expect(string.find(:element, 'input', title: XPath.contains_word('button 1'))[:type]).to eq 'button'
417
417
  end
418
418
  end
419
+
420
+ describe ':link_or_button selector' do
421
+ around(:all) do |example|
422
+ Capybara.modify_selector(:link_or_button) do
423
+ expression_filter(:random) { |xpath, _| xpath } # do nothing filter
424
+ end
425
+ example.run
426
+ Capybara::Selector.all[:link_or_button].expression_filters.delete(:random)
427
+ end
428
+
429
+ context 'when modified' do
430
+ it 'should still work' do
431
+ expect(string.find(:link_or_button, 'click me', random: 'blah').value).to eq 'click me'
432
+ end
433
+ end
434
+ end
419
435
  end
420
436
  end
421
437
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.11.0
4
+ version: 3.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Walpole
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain:
12
12
  - gem-public_cert.pem
13
- date: 2018-11-14 00:00:00.000000000 Z
13
+ date: 2018-11-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable