fwt_bootstrap_rails 0.2.0 → 0.2.1
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: 03faadd618e1cf964ef4ea154066a97f8331fa03
|
4
|
+
data.tar.gz: 3b1728a1efc224f0386fe0e73af2d008dbca0a71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d2f529117619117359ce6a484ff473b4b2cbb76776a473ce645d864d3e5f45cc51d0e3d375e347cd751c825d55c95f8132fb069444b2b3a21e3c29996c524b2
|
7
|
+
data.tar.gz: dec4b83eda7e8b7386ebe5674b03ecdddf4d244eeb327dbbc2a51bd8353b7f3688958470e6a550d5a7fd5f492499a6cf140736ed6ec547d956f6d7ce553e4cd0
|
@@ -88,7 +88,7 @@ class BootstrapFormBuilder < ActionView::Helpers::FormBuilder
|
|
88
88
|
elsif method_name == :check_box
|
89
89
|
options = args.extract_options!
|
90
90
|
options[:checked] = (@object.send(name) == true)
|
91
|
-
bootstrap_checkbox(name, super(
|
91
|
+
bootstrap_checkbox(name, super(@object_name, name, *(args << options)))
|
92
92
|
else
|
93
93
|
options = args.extract_options!
|
94
94
|
options[:class] = "form-control"
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'spec_helper.rb'
|
2
|
+
require 'bootstrap_form_builder.rb'
|
3
|
+
|
4
|
+
class TestHelper < ActionView::Base; end
|
5
|
+
|
6
|
+
describe BootstrapFormBuilder do
|
7
|
+
|
8
|
+
describe '#checkbox' do
|
9
|
+
|
10
|
+
let(:helper) { TestHelper.new }
|
11
|
+
let(:resource) { User.new }
|
12
|
+
let(:builder) { BootstrapFormBuilder.new :user, resource, helper, {} }
|
13
|
+
let(:output) {
|
14
|
+
builder.check_box(:administrator)
|
15
|
+
}
|
16
|
+
|
17
|
+
it 'wraps input and label' do
|
18
|
+
expect(output).to have_tag('input', :with => { :id => :user_administrator })
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'creates a label' do
|
22
|
+
expect(output).to include '<label'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class User
|
28
|
+
attr_accessor :administrator
|
29
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fwt_bootstrap_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brooke-Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass-rails
|
@@ -201,6 +201,7 @@ files:
|
|
201
201
|
- fwt_bootstrap_rails.gemspec
|
202
202
|
- lib/fwt_bootstrap_rails.rb
|
203
203
|
- lib/fwt_bootstrap_rails/version.rb
|
204
|
+
- spec/builders/bootstrap_form_builder_spec.rb
|
204
205
|
- spec/dummy/README.rdoc
|
205
206
|
- spec/dummy/Rakefile
|
206
207
|
- spec/dummy/app/assets/images/.keep
|
@@ -264,6 +265,7 @@ signing_key:
|
|
264
265
|
specification_version: 4
|
265
266
|
summary: Helpers for using Bootstrap 3 with Rails
|
266
267
|
test_files:
|
268
|
+
- spec/builders/bootstrap_form_builder_spec.rb
|
267
269
|
- spec/dummy/README.rdoc
|
268
270
|
- spec/dummy/Rakefile
|
269
271
|
- spec/dummy/app/assets/images/.keep
|