rspec-capybara-simple_form-rails 0.0.3 → 0.0.4
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: 4347b35db937eb2207a8ab8c6b6d82ee30bacf7b
|
4
|
+
data.tar.gz: 9eb8bf00098fddb8598d7208d1eead76b8d4f86f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbfd6d9bdd8ba039a519dae076b1a29832f754ad6ef35b5ae2dfdda703097e94ef0796f0d91ab396f0d517d39830e39c6ac5243eeacf0367e75c6a293b30a12c
|
7
|
+
data.tar.gz: fd8c29eb8774764100d8211beb748e83ce0fc0a259591590137da0ecbebd0c3abf0770cf2e80fb90b90d48eac8f1e28836de02ad29dd291b44b65f9dd962a1fb
|
@@ -1,8 +1,12 @@
|
|
1
1
|
RSpec::Matchers.define :have_field do |model, name, ftype, dtype, options = {}|
|
2
2
|
match do |rendered|
|
3
3
|
# define the field key
|
4
|
-
|
5
|
-
|
4
|
+
if (model.is_a?(ActiveRecord::Base))
|
5
|
+
field_key = "#{model.class.to_s.underscore}_#{name.to_s.underscore}"
|
6
|
+
field_key = field_key.gsub(/\//, '_')
|
7
|
+
else
|
8
|
+
field_key = "#{model.to_s.underscore}_#{name.to_s.underscore}"
|
9
|
+
end
|
6
10
|
|
7
11
|
# build the check string
|
8
12
|
checkstring = "#{dtype}"
|