capybara-select2 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,22 @@
1
1
  require "capybara-select2/version"
2
- require 'capybara/select2'
2
+
3
+ module Capybara
4
+ module Select2
5
+ def select2(value, options={})
6
+ raise "Must pass a hash containing 'from'" if not options.is_a?(Hash) or not options.has_key?(:from)
7
+ select_name = options[:from]
8
+
9
+ select2_container=find("label:contains(\"#{select_name}\")").find(:xpath, '..').find(".select2-container")
10
+ PP.pp(select2_container)
11
+
12
+ select2_container.find(".select2-choice").click
13
+
14
+ find(".select2-drop li:contains(\"#{value}\")").click
15
+
16
+ end
17
+ end
18
+ end
19
+
20
+ RSpec.configure do |c|
21
+ c.include Capybara::Select2
22
+ end
@@ -1,5 +1,5 @@
1
1
  module Capybara
2
2
  module Select2
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -1,21 +1 @@
1
- module Capybara
2
- module Select2
3
- def select2(value, options={})
4
- raise "Must pass a hash containing 'from'" if not options.is_a?(Hash) or not options.has_key?(:from)
5
- select_name = options[:from]
6
-
7
- select2_container=find("label:contains(\"#{select_name}\")").find(:xpath, '..').find(".select2-container")
8
- PP.pp(select2_container)
9
-
10
- select2_container.find(".select2-choice").click
11
-
12
- find(".select2-drop li:contains(\"#{value}\")").click
13
-
14
- end
15
- end
16
- end
17
-
18
- RSpec.configure do |c|
19
- c.include Capybara::Select2
20
- end
21
-
1
+ require '../capybara-select2'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-select2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: