watir_drops 0.5.4 → 0.5.5

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
  SHA1:
3
- metadata.gz: a7aafeffa7381f8f1484e15f6fc595eee2bbfd3e
4
- data.tar.gz: c74590ac2bc949015e0f2483cbc1a25547ecfb08
3
+ metadata.gz: 87a0011675d541899558e200f9f9dbae7e1a284a
4
+ data.tar.gz: 9bcf850b3131024d493f78df7a8350e4ca624bed
5
5
  SHA512:
6
- metadata.gz: 67e12bca8431b3b02aa75afd7988db7d256ad34c2a6d0314b93bd2a2d52efd3b812f1164efb9fbeefa19772f553a185c87cc70e276ae8d9bc4a21c740e85c98c
7
- data.tar.gz: c0e5f9e7aa077d67c3ca427d05f29061091960710df00dbcb16426409743ff3d4839facbcca04309e98fa3f8260e85b542e56486cae5d4887c6777a866ec91e2
6
+ metadata.gz: 7de887e283d9ff9b641599090ac24d41e41a6a19e6cc77e746637ac4552325b7df2fdea1a9748facf9ae3614ed680aed4aed073ca881865eb44741cfa87cd4b9
7
+ data.tar.gz: 7c09c4b66b30d434cfe9d3c856b324dd852c94d34d2c2a5b3054930d8ae35dbfb82458d828673aac27b39667ea4abc0c12d65472d0bff2fcdf9d783dcf1844dc
@@ -38,20 +38,20 @@ module WatirDrops
38
38
  watir_element = self.instance_exec &block
39
39
  watir_element.wait_until_present
40
40
  case watir_element
41
- when Watir::Radio
42
- watir_element.set if val
43
- when Watir::CheckBox
44
- val ? watir_element.set : watir_element.clear
45
- when Watir::Select
46
- watir_element.select val
47
- when Watir::Button
48
- watir_element.click
41
+ when Watir::Radio
42
+ watir_element.set if val
43
+ when Watir::CheckBox
44
+ val ? watir_element.set : watir_element.clear
45
+ when Watir::Select
46
+ watir_element.select val
47
+ when Watir::Button
48
+ watir_element.click
49
49
  # TODO - Email & Password types are not set to UserEditable in Watir
50
- when Watir::Input
51
- watir_element.wd.clear
52
- watir_element.send_keys val
53
- else
54
- watir_element.click if val
50
+ when Watir::Input
51
+ watir_element.wd.clear
52
+ watir_element.send_keys val
53
+ else
54
+ watir_element.click if val
55
55
  end
56
56
  end
57
57
 
@@ -86,8 +86,14 @@ module WatirDrops
86
86
  end
87
87
 
88
88
  def fill_form(model)
89
- model = model.to_h if model.is_a? OpenStruct
90
- intersect = self.class.element_list & model.keys.select {|el| !model.send(el).nil?}
89
+ intersect = case model
90
+ when OpenStruct
91
+ self.class.element_list & model.to_h.keys
92
+ when Hash
93
+ self.class.element_list & model.keys
94
+ else
95
+ self.class.element_list & model.keys.select { |el| !model.send(el).nil? }
96
+ end
91
97
  intersect.each do |val|
92
98
  self.send("#{val}=", model[val])
93
99
  end
data/watir_drops.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'watir_drops'
5
- spec.version = '0.5.4'
5
+ spec.version = '0.5.5'
6
6
  spec.authors = ['Titus Fortner']
7
7
  spec.email = ['titusfortner@gmail.com']
8
8
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir_drops
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Titus Fortner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-20 00:00:00.000000000 Z
11
+ date: 2016-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport