speedo-formstrap 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -2
- data/Gemfile.lock +42 -40
- data/README.md +8 -15
- data/Rakefile +3 -3
- data/VERSION +1 -1
- data/formtastic-bootstrap.gemspec +133 -0
- data/lib/{speedo-formstrap → formtastic-bootstrap}/engine.rb +1 -1
- data/lib/{speedo-formstrap → formtastic-bootstrap}/form_builder.rb +9 -11
- data/lib/{speedo-formstrap → formtastic-bootstrap}/helpers/buttons_helper.rb +10 -14
- data/lib/{speedo-formstrap → formtastic-bootstrap}/helpers/fieldset_wrapper.rb +7 -12
- data/lib/{speedo-formstrap → formtastic-bootstrap}/helpers/input_helper.rb +2 -2
- data/lib/{speedo-formstrap → formtastic-bootstrap}/helpers/inputs_helper.rb +6 -6
- data/lib/{speedo-formstrap → formtastic-bootstrap}/helpers.rb +6 -8
- data/lib/formtastic-bootstrap/inputs/base/choices.rb +49 -0
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/base/errors.rb +1 -1
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/base/hints.rb +1 -1
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/base/html.rb +1 -1
- data/lib/formtastic-bootstrap/inputs/base/labelling.rb +18 -0
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/base/stringish.rb +1 -1
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/base/timeish.rb +13 -6
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/base/wrapping.rb +15 -33
- data/lib/formtastic-bootstrap/inputs/base.rb +22 -0
- data/lib/formtastic-bootstrap/inputs/boolean_input.rb +33 -0
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/check_boxes_input.rb +10 -11
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/date_input.rb +1 -1
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/datetime_input.rb +1 -1
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/email_input.rb +1 -1
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/file_input.rb +1 -1
- data/lib/formtastic-bootstrap/inputs/hidden_input.rb +12 -0
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/number_input.rb +3 -3
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/password_input.rb +1 -1
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/phone_input.rb +1 -1
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/radio_input.rb +13 -14
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/range_input.rb +3 -3
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/search_input.rb +1 -1
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/select_input.rb +1 -1
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/string_input.rb +1 -1
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/text_input.rb +1 -1
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/time_input.rb +1 -1
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/time_zone_input.rb +1 -1
- data/lib/{speedo-formstrap → formtastic-bootstrap}/inputs/url_input.rb +1 -1
- data/lib/formtastic-bootstrap/inputs.rb +29 -0
- data/lib/formtastic-bootstrap.rb +6 -0
- data/spec/builder/errors_spec.rb +214 -0
- data/spec/builder/semantic_fields_for_spec.rb +14 -14
- data/spec/helpers/buttons_helper_spec.rb +45 -55
- data/spec/helpers/input_helper_spec.rb +188 -188
- data/spec/helpers/inputs_helper_spec.rb +102 -116
- data/spec/inputs/boolean_input_spec.rb +44 -72
- data/spec/inputs/check_boxes_input_spec.rb +80 -108
- data/spec/inputs/date_input_spec.rb +14 -80
- data/spec/inputs/datetime_input_spec.rb +12 -12
- data/spec/inputs/email_input_spec.rb +5 -33
- data/spec/inputs/file_input_spec.rb +5 -33
- data/spec/inputs/hidden_input_spec.rb +12 -40
- data/spec/inputs/number_input_spec.rb +96 -126
- data/spec/inputs/password_input_spec.rb +5 -33
- data/spec/inputs/phone_input_spec.rb +5 -33
- data/spec/inputs/radio_input_spec.rb +44 -72
- data/spec/inputs/range_input_spec.rb +65 -93
- data/spec/inputs/search_input_spec.rb +5 -32
- data/spec/inputs/select_input_spec.rb +77 -123
- data/spec/inputs/string_input_spec.rb +21 -66
- data/spec/inputs/text_input_spec.rb +13 -40
- data/spec/inputs/time_input_spec.rb +22 -22
- data/spec/inputs/time_zone_input_spec.rb +17 -17
- data/spec/inputs/url_input_spec.rb +5 -33
- data/spec/spec_helper.rb +1 -1
- data/spec/support/custom_macros.rb +188 -59
- data/spec/support/formtastic_spec_helper.rb +3 -19
- data/vendor/assets/stylesheets/formtastic-bootstrap.css +3 -0
- metadata +62 -74
- data/lib/speedo-formstrap/actions/base.rb +0 -18
- data/lib/speedo-formstrap/actions/button_action.rb +0 -7
- data/lib/speedo-formstrap/actions/input_action.rb +0 -7
- data/lib/speedo-formstrap/actions/link_action.rb +0 -7
- data/lib/speedo-formstrap/actions.rb +0 -4
- data/lib/speedo-formstrap/helpers/action_helper.rb +0 -12
- data/lib/speedo-formstrap/helpers/actions_helper.rb +0 -23
- data/lib/speedo-formstrap/inputs/base/choices.rb +0 -38
- data/lib/speedo-formstrap/inputs/base/labelling.rb +0 -28
- data/lib/speedo-formstrap/inputs/base/numeric.rb +0 -18
- data/lib/speedo-formstrap/inputs/base.rb +0 -23
- data/lib/speedo-formstrap/inputs/boolean_input.rb +0 -29
- data/lib/speedo-formstrap/inputs/hidden_input.rb +0 -14
- data/lib/speedo-formstrap/inputs.rb +0 -29
- data/lib/speedo-formstrap.rb +0 -7
- data/spec/actions/button_action_spec.rb +0 -68
- data/spec/actions/generic_action_spec.rb +0 -486
- data/spec/actions/input_action_spec.rb +0 -64
- data/spec/actions/link_action_spec.rb +0 -93
- data/spec/helpers/action_helper_spec.rb +0 -365
- data/spec/helpers/actions_helper_spec.rb +0 -143
- data/speedo-formstrap.gemspec +0 -145
@@ -1,143 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
describe 'Formtastic::FormBuilder#actions' do
|
5
|
-
|
6
|
-
include FormtasticSpecHelper
|
7
|
-
|
8
|
-
before do
|
9
|
-
@output_buffer = ''
|
10
|
-
mock_everything
|
11
|
-
Formtastic::Helpers::FormHelper.builder = SpeedoFormstrap::FormBuilder
|
12
|
-
end
|
13
|
-
|
14
|
-
describe 'with a block' do
|
15
|
-
describe 'when no options are provided' do
|
16
|
-
before do
|
17
|
-
concat(semantic_form_for(@new_post) do |builder|
|
18
|
-
concat(builder.actions do
|
19
|
-
concat('hello')
|
20
|
-
end)
|
21
|
-
end)
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'should render a fieldset inside the form, with a class of "actions"' do
|
25
|
-
output_buffer.should have_tag("form fieldset.form-actions")
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'should render an ol inside the fieldset' do
|
29
|
-
output_buffer.should_not have_tag("form fieldset.form-actions ol")
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'should render the contents of the block inside the ol' do
|
33
|
-
output_buffer.should have_tag("form fieldset.form-actions", /hello/)
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'should not render a legend inside the fieldset' do
|
37
|
-
output_buffer.should_not have_tag("form fieldset.form-actions legend")
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
describe 'when a :name option is provided' do
|
42
|
-
before do
|
43
|
-
@legend_text = "Advanced options"
|
44
|
-
|
45
|
-
concat(semantic_form_for(@new_post) do |builder|
|
46
|
-
builder.actions :name => @legend_text do
|
47
|
-
end
|
48
|
-
end)
|
49
|
-
end
|
50
|
-
it 'should render a fieldset inside the form' do
|
51
|
-
output_buffer.should have_tag("form fieldset.form-actions legend", /#{@legend_text}/)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
describe 'when other options are provided' do
|
56
|
-
before do
|
57
|
-
@id_option = 'advanced'
|
58
|
-
@class_option = 'wide'
|
59
|
-
|
60
|
-
concat(semantic_form_for(@new_post) do |builder|
|
61
|
-
builder.actions :id => @id_option, :class => @class_option do
|
62
|
-
end
|
63
|
-
end)
|
64
|
-
end
|
65
|
-
it 'should pass the options into the fieldset tag as attributes' do
|
66
|
-
output_buffer.should have_tag("form fieldset##{@id_option}")
|
67
|
-
output_buffer.should have_tag("form fieldset.#{@class_option}")
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|
72
|
-
|
73
|
-
describe 'without a block' do
|
74
|
-
|
75
|
-
describe 'with no args (default buttons)' do
|
76
|
-
|
77
|
-
before do
|
78
|
-
concat(semantic_form_for(@new_post) do |builder|
|
79
|
-
concat(builder.actions)
|
80
|
-
end)
|
81
|
-
end
|
82
|
-
|
83
|
-
it 'should render a form' do
|
84
|
-
output_buffer.should have_tag('form')
|
85
|
-
end
|
86
|
-
|
87
|
-
it 'should render an actions fieldset inside the form' do
|
88
|
-
output_buffer.should have_tag('form fieldset.form-actions')
|
89
|
-
end
|
90
|
-
|
91
|
-
it 'should not render a legend in the fieldset' do
|
92
|
-
output_buffer.should_not have_tag('form fieldset.form-actions legend')
|
93
|
-
end
|
94
|
-
|
95
|
-
it 'should render an ol in the fieldset' do
|
96
|
-
output_buffer.should_not have_tag('form fieldset.form-actions ol')
|
97
|
-
end
|
98
|
-
|
99
|
-
it 'should render a list item in the ol for each default action' do
|
100
|
-
output_buffer.should have_tag('form fieldset.form-actions input.action.input_action', :count => 1)
|
101
|
-
end
|
102
|
-
|
103
|
-
end
|
104
|
-
|
105
|
-
describe 'with button names as args' do
|
106
|
-
|
107
|
-
before do
|
108
|
-
concat(semantic_form_for(@new_post) do |builder|
|
109
|
-
concat(builder.actions(:submit, :cancel, :reset))
|
110
|
-
end)
|
111
|
-
end
|
112
|
-
|
113
|
-
it 'should render a form with a fieldset containing a list item for each button arg' do
|
114
|
-
output_buffer.should have_tag('form > fieldset.form-actions > .action', :count => 3)
|
115
|
-
end
|
116
|
-
|
117
|
-
end
|
118
|
-
|
119
|
-
describe 'with button names as args and an options hash' do
|
120
|
-
|
121
|
-
before do
|
122
|
-
concat(semantic_form_for(@new_post) do |builder|
|
123
|
-
concat(builder.actions(:submit, :cancel, :reset, :name => "Now click a button", :id => "my-id"))
|
124
|
-
end)
|
125
|
-
end
|
126
|
-
|
127
|
-
it 'should render a form with a fieldset containing a list item for each button arg' do
|
128
|
-
output_buffer.should have_tag('form > fieldset.form-actions > .action', :count => 3)
|
129
|
-
end
|
130
|
-
|
131
|
-
it 'should pass the options down to the fieldset' do
|
132
|
-
output_buffer.should have_tag('form > fieldset#my-id.form-actions')
|
133
|
-
end
|
134
|
-
|
135
|
-
it 'should use the special :name option as a text for the legend tag' do
|
136
|
-
output_buffer.should have_tag('form > fieldset#my-id.form-actions > legend', /Now click a button/)
|
137
|
-
end
|
138
|
-
|
139
|
-
end
|
140
|
-
|
141
|
-
end
|
142
|
-
|
143
|
-
end
|
data/speedo-formstrap.gemspec
DELETED
@@ -1,145 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = "speedo-formstrap"
|
8
|
-
s.version = "1.2.3"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Matthew Bellantoni", "Stu Basden"]
|
12
|
-
s.date = "2012-06-28"
|
13
|
-
s.description = "Formtastic form builder to generate Twitter Bootstrap-friendly markup."
|
14
|
-
s.email = "stu@t.apio.ca"
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE.txt",
|
17
|
-
"README.md"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".rspec",
|
22
|
-
"Gemfile",
|
23
|
-
"Gemfile.lock",
|
24
|
-
"LICENSE.txt",
|
25
|
-
"README.md",
|
26
|
-
"Rakefile",
|
27
|
-
"VERSION",
|
28
|
-
"lib/action_view/helpers/text_field_date_helper.rb",
|
29
|
-
"lib/speedo-formstrap.rb",
|
30
|
-
"lib/speedo-formstrap/actions.rb",
|
31
|
-
"lib/speedo-formstrap/actions/base.rb",
|
32
|
-
"lib/speedo-formstrap/actions/button_action.rb",
|
33
|
-
"lib/speedo-formstrap/actions/input_action.rb",
|
34
|
-
"lib/speedo-formstrap/actions/link_action.rb",
|
35
|
-
"lib/speedo-formstrap/engine.rb",
|
36
|
-
"lib/speedo-formstrap/form_builder.rb",
|
37
|
-
"lib/speedo-formstrap/helpers.rb",
|
38
|
-
"lib/speedo-formstrap/helpers/action_helper.rb",
|
39
|
-
"lib/speedo-formstrap/helpers/actions_helper.rb",
|
40
|
-
"lib/speedo-formstrap/helpers/buttons_helper.rb",
|
41
|
-
"lib/speedo-formstrap/helpers/fieldset_wrapper.rb",
|
42
|
-
"lib/speedo-formstrap/helpers/input_helper.rb",
|
43
|
-
"lib/speedo-formstrap/helpers/inputs_helper.rb",
|
44
|
-
"lib/speedo-formstrap/inputs.rb",
|
45
|
-
"lib/speedo-formstrap/inputs/base.rb",
|
46
|
-
"lib/speedo-formstrap/inputs/base/choices.rb",
|
47
|
-
"lib/speedo-formstrap/inputs/base/errors.rb",
|
48
|
-
"lib/speedo-formstrap/inputs/base/hints.rb",
|
49
|
-
"lib/speedo-formstrap/inputs/base/html.rb",
|
50
|
-
"lib/speedo-formstrap/inputs/base/labelling.rb",
|
51
|
-
"lib/speedo-formstrap/inputs/base/numeric.rb",
|
52
|
-
"lib/speedo-formstrap/inputs/base/stringish.rb",
|
53
|
-
"lib/speedo-formstrap/inputs/base/timeish.rb",
|
54
|
-
"lib/speedo-formstrap/inputs/base/wrapping.rb",
|
55
|
-
"lib/speedo-formstrap/inputs/boolean_input.rb",
|
56
|
-
"lib/speedo-formstrap/inputs/check_boxes_input.rb",
|
57
|
-
"lib/speedo-formstrap/inputs/date_input.rb",
|
58
|
-
"lib/speedo-formstrap/inputs/datetime_input.rb",
|
59
|
-
"lib/speedo-formstrap/inputs/email_input.rb",
|
60
|
-
"lib/speedo-formstrap/inputs/file_input.rb",
|
61
|
-
"lib/speedo-formstrap/inputs/hidden_input.rb",
|
62
|
-
"lib/speedo-formstrap/inputs/number_input.rb",
|
63
|
-
"lib/speedo-formstrap/inputs/password_input.rb",
|
64
|
-
"lib/speedo-formstrap/inputs/phone_input.rb",
|
65
|
-
"lib/speedo-formstrap/inputs/radio_input.rb",
|
66
|
-
"lib/speedo-formstrap/inputs/range_input.rb",
|
67
|
-
"lib/speedo-formstrap/inputs/search_input.rb",
|
68
|
-
"lib/speedo-formstrap/inputs/select_input.rb",
|
69
|
-
"lib/speedo-formstrap/inputs/string_input.rb",
|
70
|
-
"lib/speedo-formstrap/inputs/text_input.rb",
|
71
|
-
"lib/speedo-formstrap/inputs/time_input.rb",
|
72
|
-
"lib/speedo-formstrap/inputs/time_zone_input.rb",
|
73
|
-
"lib/speedo-formstrap/inputs/url_input.rb",
|
74
|
-
"spec/actions/button_action_spec.rb",
|
75
|
-
"spec/actions/generic_action_spec.rb",
|
76
|
-
"spec/actions/input_action_spec.rb",
|
77
|
-
"spec/actions/link_action_spec.rb",
|
78
|
-
"spec/builder/semantic_fields_for_spec.rb",
|
79
|
-
"spec/helpers/action_helper_spec.rb",
|
80
|
-
"spec/helpers/actions_helper_spec.rb",
|
81
|
-
"spec/helpers/buttons_helper_spec.rb",
|
82
|
-
"spec/helpers/input_helper_spec.rb",
|
83
|
-
"spec/helpers/inputs_helper_spec.rb",
|
84
|
-
"spec/inputs/boolean_input_spec.rb",
|
85
|
-
"spec/inputs/check_boxes_input_spec.rb",
|
86
|
-
"spec/inputs/date_input_spec.rb",
|
87
|
-
"spec/inputs/datetime_input_spec.rb",
|
88
|
-
"spec/inputs/email_input_spec.rb",
|
89
|
-
"spec/inputs/file_input_spec.rb",
|
90
|
-
"spec/inputs/hidden_input_spec.rb",
|
91
|
-
"spec/inputs/number_input_spec.rb",
|
92
|
-
"spec/inputs/password_input_spec.rb",
|
93
|
-
"spec/inputs/phone_input_spec.rb",
|
94
|
-
"spec/inputs/radio_input_spec.rb",
|
95
|
-
"spec/inputs/range_input_spec.rb",
|
96
|
-
"spec/inputs/search_input_spec.rb",
|
97
|
-
"spec/inputs/select_input_spec.rb",
|
98
|
-
"spec/inputs/string_input_spec.rb",
|
99
|
-
"spec/inputs/text_input_spec.rb",
|
100
|
-
"spec/inputs/time_input_spec.rb",
|
101
|
-
"spec/inputs/time_zone_input_spec.rb",
|
102
|
-
"spec/inputs/url_input_spec.rb",
|
103
|
-
"spec/spec_helper.rb",
|
104
|
-
"spec/support/custom_macros.rb",
|
105
|
-
"spec/support/depracation.rb",
|
106
|
-
"spec/support/formtastic_spec_helper.rb",
|
107
|
-
"speedo-formstrap.gemspec"
|
108
|
-
]
|
109
|
-
s.homepage = "http://github.com/thugsb/speedo-formstrap"
|
110
|
-
s.licenses = ["MIT"]
|
111
|
-
s.require_paths = ["lib"]
|
112
|
-
s.rubygems_version = "1.8.10"
|
113
|
-
s.summary = "Formtastic form builder to generate Twitter Bootstrap-friendly markup."
|
114
|
-
|
115
|
-
if s.respond_to? :specification_version then
|
116
|
-
s.specification_version = 3
|
117
|
-
|
118
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
119
|
-
s.add_runtime_dependency(%q<formtastic>, ["~> 2.1.0.beta1"])
|
120
|
-
s.add_runtime_dependency(%q<rails>, [">= 3.1.0"])
|
121
|
-
s.add_development_dependency(%q<rspec>, [">= 0"])
|
122
|
-
s.add_development_dependency(%q<bundler>, [">= 0"])
|
123
|
-
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
124
|
-
s.add_development_dependency(%q<rcov>, [">= 0"])
|
125
|
-
s.add_development_dependency(%q<rspec_tag_matchers>, [">= 0"])
|
126
|
-
else
|
127
|
-
s.add_dependency(%q<formtastic>, ["~> 2.1.0.beta1"])
|
128
|
-
s.add_dependency(%q<rails>, [">= 3.1.0"])
|
129
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
130
|
-
s.add_dependency(%q<bundler>, [">= 0"])
|
131
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
132
|
-
s.add_dependency(%q<rcov>, [">= 0"])
|
133
|
-
s.add_dependency(%q<rspec_tag_matchers>, [">= 0"])
|
134
|
-
end
|
135
|
-
else
|
136
|
-
s.add_dependency(%q<formtastic>, ["~> 2.1.0.beta1"])
|
137
|
-
s.add_dependency(%q<rails>, [">= 3.1.0"])
|
138
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
139
|
-
s.add_dependency(%q<bundler>, [">= 0"])
|
140
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
141
|
-
s.add_dependency(%q<rcov>, [">= 0"])
|
142
|
-
s.add_dependency(%q<rspec_tag_matchers>, [">= 0"])
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|