rspec-capybara-simple_form-rails 0.0.2 → 0.0.3

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: b267b756a1c69d62f078678b45984269586c8202
4
- data.tar.gz: 195edfffe023544d1f3dbe8c40840c7bc2b1c068
3
+ metadata.gz: 8d98eb5e7fc78f4486da7cf8da4ae8437ffc65a9
4
+ data.tar.gz: 5e1b9fb9b565f37f348fa42b979e05f7ecaea296
5
5
  SHA512:
6
- metadata.gz: ef260fb3c8f36b34fa4549b63523e8093708973b6fe4289229e3596bf66115741dffd39046c32bd4f4239fcb34b80f9b79e844eaeaa05427c119d5a1239fa840
7
- data.tar.gz: 427f9b72fb205f3fba9afcb7c1fb1cd60e1478caae2dff1547fe3784371fd9b342032378e48ea175a05196cf1c9e38a481a7d769830fd909200d4bf2d305f91d
6
+ metadata.gz: 8a5417c368a2ee041804ccf07386f920b87622ae704583a6a016fb39d86c8cf81d24e867ac4aece0716bd65da28c6930581cefba0ca6c8ce9bdd4f2b8fd766de
7
+ data.tar.gz: 68b86f95059d6a0021a3df5d1548ba9886ed4d7675bd078149f218228824c7fd7454c17d810d3d8803c19993797e7220fa67c8623726c3d0aa12f4df9804deda
@@ -9,7 +9,7 @@ RSpec::Matchers.define :have_field do |model, name, ftype, dtype, options = {}|
9
9
  checkstring = "#{checkstring}.required" if options[:required]
10
10
 
11
11
  # do our checks
12
- return false unless rendered.should have_selector("form div.control-group.#{checkstring}.#{field_key} label.#{checkstring}")
12
+ return false unless rendered.should have_selector("form div.control-group.#{checkstring}.#{field_key} label.#{checkstring}") unless options[:nolabel]
13
13
  return false unless rendered.should have_selector("form div.control-group.#{checkstring}.#{field_key} #{ftype}.#{checkstring}##{field_key}")
14
14
 
15
15
  # done
@@ -27,4 +27,11 @@ RSpec::Matchers.define :have_textarea_field do |model, name, options = {}|
27
27
  match do |rendered|
28
28
  rendered.should have_field(model, name, 'textarea','text', options)
29
29
  end
30
+ end
31
+
32
+ RSpec::Matchers.define :have_hidden_field do |model, name, options = {}|
33
+ match do |rendered|
34
+ options[:nolabel] = true
35
+ rendered.should have_field(model, name, 'input[type=hidden]','hidden', options)
36
+ end
30
37
  end
@@ -2,7 +2,7 @@ module Rspec
2
2
  module Capybara
3
3
  module SimpleForm
4
4
  module Rails
5
- VERSION = "0.0.2"
5
+ VERSION = "0.0.3"
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-capybara-simple_form-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - dei79