rspec-capybara-simple_form-rails 0.0.1 → 0.0.2

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: 288311e87c2999fbeb2b49ecf2370b9c27bae9ac
4
- data.tar.gz: a7ba4c3bfd7127b08231d3adbeb28f04d051e40a
3
+ metadata.gz: b267b756a1c69d62f078678b45984269586c8202
4
+ data.tar.gz: 195edfffe023544d1f3dbe8c40840c7bc2b1c068
5
5
  SHA512:
6
- metadata.gz: 5cd8ef8857098d34bc3079933e5ad43388eb24d476e8f6b65f9aaed8308a82cd06bc0a19b5433a5c6cc4da3f7b4720c6660ca7a1783a39d9d465a84a1707b0a9
7
- data.tar.gz: 1208679449274b9f08102e28e46ef22b227668213d226ec6b00fafbdf546a79e23dfa81b2aeee0c6ab673454ca79a0f0b969476d0f5665c06c61472ec55e46c3
6
+ metadata.gz: ef260fb3c8f36b34fa4549b63523e8093708973b6fe4289229e3596bf66115741dffd39046c32bd4f4239fcb34b80f9b79e844eaeaa05427c119d5a1239fa840
7
+ data.tar.gz: 427f9b72fb205f3fba9afcb7c1fb1cd60e1478caae2dff1547fe3784371fd9b342032378e48ea175a05196cf1c9e38a481a7d769830fd909200d4bf2d305f91d
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  A small rspec extension to verify simple form elements with the help of capybara.
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/rspec-capybara-simple_form-rails.png)](http://badge.fury.io/rb/rspec-capybara-simple_form-rails)
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
@@ -14,24 +16,19 @@ And then execute:
14
16
 
15
17
  Add the following lines to your spec_helper.rb
16
18
 
17
- ```ruby
18
19
  # load capybara
19
20
  require 'capybara/rspec'
20
21
  require 'rspec/capybara/simple_form'
21
- ```
22
22
 
23
23
  ## Usage
24
24
 
25
25
  In a view spec just use the following matchers
26
26
 
27
- ```ruby
28
27
  have_input_field(model, attribute, options)
29
28
  have_textarea_field(model, attribute, options)
30
- ```
31
29
 
32
30
  The following example illustrates a full example:
33
31
 
34
- ```ruby
35
32
  it "renders the form correct" do
36
33
 
37
34
  # assign model
@@ -44,7 +41,6 @@ The following example illustrates a full example:
44
41
  rendered.should have_input_field(@app, :name, :required => true)
45
42
  rendered.should have_textarea_field(@app, :description, :required => true)
46
43
  end
47
- ```
48
44
 
49
45
  ## Contributing
50
46
 
@@ -1,7 +1,8 @@
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.downcase}_#{name.to_s.downcase}"
4
+ field_key = "#{model.class.to_s.underscore}_#{name.to_s.underscore}"
5
+ field_key = field_key.gsub(/\//, '_')
5
6
 
6
7
  # build the check string
7
8
  checkstring = "#{dtype}"
@@ -2,7 +2,7 @@ module Rspec
2
2
  module Capybara
3
3
  module SimpleForm
4
4
  module Rails
5
- VERSION = "0.0.1"
5
+ VERSION = "0.0.2"
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.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - dei79