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: 8d98eb5e7fc78f4486da7cf8da4ae8437ffc65a9
4
- data.tar.gz: 5e1b9fb9b565f37f348fa42b979e05f7ecaea296
3
+ metadata.gz: 4347b35db937eb2207a8ab8c6b6d82ee30bacf7b
4
+ data.tar.gz: 9eb8bf00098fddb8598d7208d1eead76b8d4f86f
5
5
  SHA512:
6
- metadata.gz: 8a5417c368a2ee041804ccf07386f920b87622ae704583a6a016fb39d86c8cf81d24e867ac4aece0716bd65da28c6930581cefba0ca6c8ce9bdd4f2b8fd766de
7
- data.tar.gz: 68b86f95059d6a0021a3df5d1548ba9886ed4d7675bd078149f218228824c7fd7454c17d810d3d8803c19993797e7220fa67c8623726c3d0aa12f4df9804deda
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
- field_key = "#{model.class.to_s.underscore}_#{name.to_s.underscore}"
5
- field_key = field_key.gsub(/\//, '_')
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}"
@@ -2,7 +2,7 @@ module Rspec
2
2
  module Capybara
3
3
  module SimpleForm
4
4
  module Rails
5
- VERSION = "0.0.3"
5
+ VERSION = "0.0.4"
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - dei79