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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d98eb5e7fc78f4486da7cf8da4ae8437ffc65a9
|
4
|
+
data.tar.gz: 5e1b9fb9b565f37f348fa42b979e05f7ecaea296
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|