formulaic 0.4.0 → 0.4.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
- SHA1:
3
- metadata.gz: 5aac19cb8a6553a97ce1cf6fd5685efe3d9670cd
4
- data.tar.gz: 4b2936160b65052f3eaf8f11fed542104ef86c2e
2
+ SHA256:
3
+ metadata.gz: 3bf47076f596d2d6c8c24c3a6104013fcf64baa9988d49a26df1e34e7d924e84
4
+ data.tar.gz: d7502f483502c9198ee6b489ceeada502ff0919e4f9ca171d557ed2df5c40863
5
5
  SHA512:
6
- metadata.gz: 8aeb601d65baf8db3eb4a524b64917ca82ffc172aa3827c60c96beb2802974a6907c5569bb07d048af4f7e741f97794d89e07958902a6348c5fb123e280629f2
7
- data.tar.gz: 9821a23573b2387dde20940b476ef9e2247177c565aaeacc218deaf4f18058858d237cdc5bdb1aa926122603e9a7876ad2db857cc63804aa8f87f2ba8fa51568
6
+ metadata.gz: 73aa0ac611763b7ba09a23e2a2976923be4813a21c0f355da8a3f2086ae7bdafbf4afb053619724139767fc2ffbf75ff1c21cd8e2f8e898b0d7b7b09d174e3ca
7
+ data.tar.gz: a6bcd0e117c06e658a543593e044de0dfda999051e03c278e6137a552cee6d9218b4babb20e0dba41baa3b3adceeaee31a3ccf7256b06146ebcfef0187450591
@@ -1 +1 @@
1
- 2.4.0
1
+ 2.5
@@ -1,7 +1,8 @@
1
1
  rvm:
2
- - "2.2"
3
2
  - "2.3"
4
- - "2.4.0"
3
+ - "2.4"
4
+ - "2.5"
5
+ - "2.6"
5
6
  - "ruby-head"
6
7
  notifications:
7
8
  email: false
data/README.md CHANGED
@@ -112,7 +112,7 @@ class ActionDispatch::IntegrationTest
112
112
  end
113
113
  ```
114
114
 
115
- ### Integration with [FactoryGirl](https://github.com/thoughtbot/factory_girl)
115
+ ### Integration with [Factory Bot](https://github.com/thoughtbot/factory_bot)
116
116
 
117
117
  ```ruby
118
118
  fill_form(:user, attributes_for(:user))
@@ -185,4 +185,4 @@ Thank you!
185
185
  [team]: https://thoughtbot.com/austin?utm_source=github
186
186
  [contributors]: http://github.com/thoughtbot/formulaic/contributors
187
187
 
188
- [![Ralph](http://thoughtbot.com/assets/thoughtbot-logo.png)](http://thoughtbot.com)
188
+ [![thoughtbot](http://presskit.thoughtbot.com/images/thoughtbot-logo-for-readmes.svg)](https://thoughtbot.com/)
data/Rakefile CHANGED
@@ -1,6 +1,3 @@
1
1
  require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
2
 
6
3
  task default: :spec
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency 'i18n'
26
26
  spec.add_dependency 'activesupport'
27
27
 
28
- spec.add_development_dependency 'bundler', '~> 1.3'
28
+ spec.add_development_dependency 'bundler'
29
29
  spec.add_development_dependency 'rake'
30
30
  spec.add_development_dependency 'rspec'
31
31
  spec.add_development_dependency 'pry'
@@ -1,11 +1,6 @@
1
1
  module Formulaic
2
2
  module Inputs
3
3
  class ArrayInput < Input
4
- def initialize(label, value)
5
- @label = label
6
- @value = value
7
- end
8
-
9
4
  def fill
10
5
  attempt_to_fill_selects ||
11
6
  attempt_to_fill_checkboxes ||
@@ -3,9 +3,9 @@ module Formulaic
3
3
  class BooleanInput < Input
4
4
  def fill
5
5
  if value
6
- check(label)
6
+ check(label.to_str)
7
7
  else
8
- uncheck(label)
8
+ uncheck(label.to_str)
9
9
  end
10
10
  end
11
11
  end
@@ -2,7 +2,7 @@ module Formulaic
2
2
  module Inputs
3
3
  class FileInput < Input
4
4
  def fill
5
- attach_file(label, value.path)
5
+ attach_file(label.to_str, value.path)
6
6
  end
7
7
  end
8
8
  end
@@ -21,7 +21,7 @@ module Formulaic
21
21
  end
22
22
 
23
23
  def has_select?
24
- has_field?(label, type: "select")
24
+ has_field?(label.to_str, type: "select")
25
25
  end
26
26
 
27
27
  def select_is_multiple?
@@ -30,7 +30,7 @@ module Formulaic
30
30
  end
31
31
 
32
32
  def select_element
33
- @select_element ||= find_field(label, type: "select")
33
+ @select_element ||= find_field(label.to_str, type: "select")
34
34
  end
35
35
  end
36
36
  end
@@ -2,19 +2,19 @@ module Formulaic
2
2
  module Inputs
3
3
  class StringInput < Input
4
4
  def fill
5
- if page.has_selector?(:fillable_field, label, wait: Formulaic.default_wait_time)
6
- fill_in(label, with: value)
7
- elsif page.has_selector?(:radio_button, label, wait: Formulaic.default_wait_time)
5
+ if page.has_selector?(:fillable_field, label.to_str, wait: Formulaic.default_wait_time)
6
+ fill_in(label.to_str, with: value)
7
+ elsif page.has_selector?(:radio_button, label.to_str, wait: Formulaic.default_wait_time)
8
8
  choose(value)
9
- elsif has_option_in_select?(translate_option(value), label)
10
- select(translate_option(value), from: label)
9
+ elsif has_option_in_select?(translate_option(value), label.to_str)
10
+ select(translate_option(value), from: label.to_str)
11
11
  else
12
12
  raise Formulaic::InputNotFound.new(%[Unable to find input "#{label}".])
13
13
  end
14
14
  end
15
15
 
16
16
  def has_option_in_select?(option, select)
17
- element = find(:select, select)
17
+ element = find(:select, select.to_str)
18
18
  if ! element.has_selector?(:option, option, wait: Formulaic.default_wait_time)
19
19
  raise Formulaic::OptionForSelectInputNotFound.new(%[Unable to find option with text matching "#{option}".])
20
20
  end
@@ -1,3 +1,3 @@
1
1
  module Formulaic
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formulaic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Thompson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-06 00:00:00.000000000 Z
11
+ date: 2019-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '1.3'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '1.3'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  version: '0'
176
176
  requirements: []
177
177
  rubyforge_project:
178
- rubygems_version: 2.6.8
178
+ rubygems_version: 2.7.6
179
179
  signing_key:
180
180
  specification_version: 4
181
181
  summary: Simplify form filling with Capybara