speedo-formstrap 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. data/README.md +2 -2
  2. data/Rakefile +1 -1
  3. data/VERSION +1 -1
  4. data/formtastic-bootstrap.gemspec +1 -1
  5. data/lib/formtastic-bootstrap.rb +5 -5
  6. data/lib/formtastic-bootstrap/actions.rb +4 -4
  7. data/lib/formtastic-bootstrap/actions/base.rb +1 -1
  8. data/lib/formtastic-bootstrap/actions/button_action.rb +1 -1
  9. data/lib/formtastic-bootstrap/actions/input_action.rb +1 -1
  10. data/lib/formtastic-bootstrap/actions/link_action.rb +1 -1
  11. data/lib/formtastic-bootstrap/engine.rb +1 -1
  12. data/lib/formtastic-bootstrap/form_builder.rb +9 -11
  13. data/lib/formtastic-bootstrap/helpers.rb +6 -8
  14. data/lib/formtastic-bootstrap/helpers/action_helper.rb +2 -2
  15. data/lib/formtastic-bootstrap/helpers/actions_helper.rb +2 -2
  16. data/lib/formtastic-bootstrap/helpers/buttons_helper.rb +10 -14
  17. data/lib/formtastic-bootstrap/helpers/fieldset_wrapper.rb +7 -12
  18. data/lib/formtastic-bootstrap/helpers/input_helper.rb +2 -2
  19. data/lib/formtastic-bootstrap/helpers/inputs_helper.rb +6 -6
  20. data/lib/formtastic-bootstrap/inputs.rb +21 -21
  21. data/lib/formtastic-bootstrap/inputs/base.rb +10 -11
  22. data/lib/formtastic-bootstrap/inputs/base/choices.rb +24 -13
  23. data/lib/formtastic-bootstrap/inputs/base/errors.rb +1 -1
  24. data/lib/formtastic-bootstrap/inputs/base/hints.rb +1 -1
  25. data/lib/formtastic-bootstrap/inputs/base/html.rb +1 -1
  26. data/lib/formtastic-bootstrap/inputs/base/labelling.rb +7 -17
  27. data/lib/formtastic-bootstrap/inputs/base/numeric.rb +1 -1
  28. data/lib/formtastic-bootstrap/inputs/base/stringish.rb +1 -1
  29. data/lib/formtastic-bootstrap/inputs/base/timeish.rb +13 -6
  30. data/lib/formtastic-bootstrap/inputs/base/wrapping.rb +15 -33
  31. data/lib/formtastic-bootstrap/inputs/boolean_input.rb +1 -1
  32. data/lib/formtastic-bootstrap/inputs/check_boxes_input.rb +1 -1
  33. data/lib/formtastic-bootstrap/inputs/date_input.rb +1 -1
  34. data/lib/formtastic-bootstrap/inputs/datetime_input.rb +1 -1
  35. data/lib/formtastic-bootstrap/inputs/email_input.rb +1 -1
  36. data/lib/formtastic-bootstrap/inputs/file_input.rb +1 -1
  37. data/lib/formtastic-bootstrap/inputs/hidden_input.rb +1 -1
  38. data/lib/formtastic-bootstrap/inputs/number_input.rb +3 -3
  39. data/lib/formtastic-bootstrap/inputs/password_input.rb +1 -1
  40. data/lib/formtastic-bootstrap/inputs/phone_input.rb +1 -1
  41. data/lib/formtastic-bootstrap/inputs/radio_input.rb +13 -14
  42. data/lib/formtastic-bootstrap/inputs/range_input.rb +3 -3
  43. data/lib/formtastic-bootstrap/inputs/search_input.rb +1 -1
  44. data/lib/formtastic-bootstrap/inputs/select_input.rb +1 -1
  45. data/lib/formtastic-bootstrap/inputs/string_input.rb +1 -1
  46. data/lib/formtastic-bootstrap/inputs/text_input.rb +1 -1
  47. data/lib/formtastic-bootstrap/inputs/time_input.rb +1 -1
  48. data/lib/formtastic-bootstrap/inputs/time_zone_input.rb +1 -1
  49. data/lib/formtastic-bootstrap/inputs/url_input.rb +1 -1
  50. data/spec/actions/button_action_spec.rb +1 -1
  51. data/spec/actions/generic_action_spec.rb +1 -1
  52. data/spec/actions/input_action_spec.rb +1 -1
  53. data/spec/actions/link_action_spec.rb +1 -1
  54. data/spec/builder/semantic_fields_for_spec.rb +16 -16
  55. data/spec/helpers/action_helper_spec.rb +1 -1
  56. data/spec/helpers/actions_helper_spec.rb +1 -1
  57. data/spec/helpers/buttons_helper_spec.rb +46 -56
  58. data/spec/helpers/input_helper_spec.rb +209 -209
  59. data/spec/helpers/inputs_helper_spec.rb +103 -117
  60. data/spec/inputs/boolean_input_spec.rb +46 -74
  61. data/spec/inputs/check_boxes_input_spec.rb +82 -110
  62. data/spec/inputs/date_input_spec.rb +15 -81
  63. data/spec/inputs/datetime_input_spec.rb +13 -13
  64. data/spec/inputs/email_input_spec.rb +6 -34
  65. data/spec/inputs/file_input_spec.rb +6 -34
  66. data/spec/inputs/hidden_input_spec.rb +13 -41
  67. data/spec/inputs/number_input_spec.rb +97 -127
  68. data/spec/inputs/password_input_spec.rb +6 -34
  69. data/spec/inputs/phone_input_spec.rb +6 -34
  70. data/spec/inputs/radio_input_spec.rb +45 -73
  71. data/spec/inputs/range_input_spec.rb +66 -94
  72. data/spec/inputs/search_input_spec.rb +6 -33
  73. data/spec/inputs/select_input_spec.rb +78 -124
  74. data/spec/inputs/string_input_spec.rb +22 -67
  75. data/spec/inputs/text_input_spec.rb +15 -42
  76. data/spec/inputs/time_input_spec.rb +23 -23
  77. data/spec/inputs/time_zone_input_spec.rb +20 -20
  78. data/spec/inputs/url_input_spec.rb +6 -34
  79. data/spec/support/custom_macros.rb +196 -67
  80. data/spec/support/formtastic_spec_helper.rb +6 -22
  81. data/speedo-formstrap.gemspec +146 -0
  82. metadata +18 -17
@@ -8,7 +8,7 @@ describe 'date input' do
8
8
  before do
9
9
  @output_buffer = ''
10
10
  mock_everything
11
- Formtastic::Helpers::FormHelper.builder = FormtasticBootstrap::FormBuilder
11
+ Formtastic::Helpers::FormHelper.builder = SpeedoFormstrap::FormBuilder
12
12
  end
13
13
 
14
14
  describe "general" do
@@ -20,8 +20,8 @@ describe 'date input' do
20
20
  end)
21
21
  end
22
22
 
23
- it_should_have_input_wrapper_with_class("date-wrapper")
24
- it_should_have_input_wrapper_with_class("control-group")
23
+ it_should_have_input_wrapper_with_class("date")
24
+ it_should_have_input_wrapper_with_class(:clearfix)
25
25
  it_should_have_input_wrapper_with_class(:stringish)
26
26
  it_should_have_input_class_in_the_right_place
27
27
  it_should_have_input_wrapper_with_id("post_publish_at_input")
@@ -31,7 +31,7 @@ describe 'date input' do
31
31
  it_should_apply_error_logic_for_input_type(:date)
32
32
 
33
33
  it 'should have a legend and label with the label text inside the fieldset' do
34
- output_buffer.should have_tag('form div.control-group.date-wrapper label.control-label', /Publish at/)
34
+ output_buffer.should have_tag('form div.clearfix.date label', /Publish at/)
35
35
  end
36
36
 
37
37
  # it 'should associate the legend label with the first select' do
@@ -42,8 +42,8 @@ describe 'date input' do
42
42
  # end
43
43
 
44
44
  it 'should (sort of) associate the label with the input' do
45
- output_buffer.should have_tag('form div.control-group.date-wrapper label.control-label[@for="post_publish_at"]')
46
- output_buffer.should have_tag('form div.control-group.date-wrapper div.controls input[@id="post_publish_at[date]"]')
45
+ output_buffer.should have_tag('form div.clearfix.date label[@for="post_publish_at"]')
46
+ output_buffer.should have_tag('form div.clearfix.date div.input input[@id="post_publish_at[date]"]')
47
47
  end
48
48
 
49
49
  # it 'should have an ordered list of three items inside the fieldset' do
@@ -58,7 +58,7 @@ describe 'date input' do
58
58
  # output_buffer.should have_tag('form li.date fieldset ol li label', /day/i)
59
59
  # end
60
60
  it 'should have an text input inside the div' do
61
- output_buffer.should have_tag('form div.control-group.date-wrapper div.controls input[@type="text"]')
61
+ output_buffer.should have_tag('form div.clearfix.date div.input input[@type="text"]')
62
62
  end
63
63
 
64
64
  # it 'should have three selects for year, month and day' do
@@ -97,7 +97,7 @@ describe 'date input' do
97
97
  # output_buffer.should have_tag('form li.date fieldset ol li label', f == field ? /another #{f} label/i : /#{f}/i)
98
98
  # end
99
99
  # end
100
- #
100
+ #
101
101
  # it "should not display the label for the #{field} field when :labels[:#{field}] is blank" do
102
102
  # output_buffer.replace ''
103
103
  # concat(semantic_form_for(@new_post) do |builder|
@@ -108,7 +108,7 @@ describe 'date input' do
108
108
  # output_buffer.should have_tag('form li.date fieldset ol li label', /#{f}/i) unless field == f
109
109
  # end
110
110
  # end
111
- #
111
+ #
112
112
  # it "should not display the label for the #{field} field when :labels[:#{field}] is false" do
113
113
  # output_buffer.replace ''
114
114
  # concat(semantic_form_for(@new_post) do |builder|
@@ -119,21 +119,21 @@ describe 'date input' do
119
119
  # output_buffer.should have_tag('form li.date fieldset ol li label', /#{f}/i) unless field == f
120
120
  # end
121
121
  # end
122
- #
123
- # it "should not render unsafe HTML when :labels[:#{field}] is false" do
122
+ #
123
+ # it "should not render unsafe HTML when :labels[:#{field}] is false" do
124
124
  # output_buffer.replace ''
125
125
  # concat(semantic_form_for(@new_post) do |builder|
126
126
  # concat(builder.input(:created_at, :as => :time, :include_seconds => true, :labels => { field => false }))
127
127
  # end)
128
128
  # output_buffer.should_not include(">")
129
129
  # end
130
- #
130
+ #
131
131
  # end
132
132
  # end
133
-
133
+
134
134
  describe "when required" do
135
135
  it "should add the required attribute to the input's html options" do
136
- with_config :use_required_attribute, true do
136
+ with_config :use_required_attribute, true do
137
137
  concat(semantic_form_for(@new_post) do |builder|
138
138
  concat(builder.input(:title, :as => :date, :required => true))
139
139
  end)
@@ -143,71 +143,5 @@ describe 'date input' do
143
143
  end
144
144
  end
145
145
  end
146
-
147
- # We use text field for dates
148
-
149
- # describe "when order does not include day" do
150
- # before do
151
- # output_buffer.replace ''
152
- # concat(semantic_form_for(@new_post) do |builder|
153
- # concat(builder.input(:publish_at, :as => :date, :order => [:year, :month]))
154
- # end)
155
- # end
156
- #
157
- # it "should include a hidden input for day" do
158
- # output_buffer.should have_tag('input[@type="hidden"][@name="post[publish_at(3i)]"][@value="1"]')
159
- # end
160
- #
161
- # it "should not include a select for day" do
162
- # output_buffer.should_not have_tag('select[@name="post[publish_at(3i)]"]')
163
- # end
164
- # end
165
- #
166
- # describe "when order does not include month" do
167
- # before do
168
- # output_buffer.replace ''
169
- # concat(semantic_form_for(@new_post) do |builder|
170
- # concat(builder.input(:publish_at, :as => :date, :order => [:year, :day]))
171
- # end)
172
- # end
173
- #
174
- # it "should include a hidden input for month" do
175
- # output_buffer.should have_tag('input[@type="hidden"][@name="post[publish_at(2i)]"][@value="1"]')
176
- # end
177
- #
178
- # it "should not include a select for month" do
179
- # output_buffer.should_not have_tag('select[@name="post[publish_at(2i)]"]')
180
- # end
181
- # end
182
- #
183
- # describe "when order does not include year" do
184
- # before do
185
- # output_buffer.replace ''
186
- # concat(semantic_form_for(@new_post) do |builder|
187
- # concat(builder.input(:publish_at, :as => :date, :order => [:month, :day]))
188
- # end)
189
- # end
190
- #
191
- # it "should include a hidden input for month" do
192
- # output_buffer.should have_tag("input[@type=\"hidden\"][@name=\"post[publish_at(1i)]\"][@value=\"#{Time.now.year}\"]")
193
- # end
194
- #
195
- # it "should not include a select for month" do
196
- # output_buffer.should_not have_tag('select[@name="post[publish_at(1i)]"]')
197
- # end
198
- # end
199
- #
200
- # describe "when order does not have year first" do
201
- # before do
202
- # output_buffer.replace ''
203
- # concat(semantic_form_for(@new_post) do |builder|
204
- # concat(builder.input(:publish_at, :as => :date, :order => [:day, :month, :year]))
205
- # end)
206
- # end
207
- #
208
- # it 'should associate the legend label with the new first select' do
209
- # output_buffer.should have_tag('form li.date fieldset legend.label label[@for="post_publish_at_3i"]')
210
- # end
211
- # end
212
-
146
+
213
147
  end
@@ -8,7 +8,7 @@ describe 'datetime input' do
8
8
  before do
9
9
  @output_buffer = ''
10
10
  mock_everything
11
- Formtastic::Helpers::FormHelper.builder = FormtasticBootstrap::FormBuilder
11
+ Formtastic::Helpers::FormHelper.builder = SpeedoFormstrap::FormBuilder
12
12
  end
13
13
 
14
14
  describe "general" do
@@ -21,8 +21,8 @@ describe 'datetime input' do
21
21
  end)
22
22
  end
23
23
 
24
- it_should_have_input_wrapper_with_class("datetime-wrapper")
25
- it_should_have_input_wrapper_with_class("control-group")
24
+ it_should_have_input_wrapper_with_class("datetime")
25
+ it_should_have_input_wrapper_with_class(:clearfix)
26
26
  it_should_have_input_wrapper_with_class(:stringish) # Decide about this.
27
27
  it_should_have_input_class_in_the_right_place
28
28
  it_should_have_input_wrapper_with_id("post_publish_at_input")
@@ -30,9 +30,9 @@ describe 'datetime input' do
30
30
  # it_should_have_a_nested_fieldset_with_class('fragments')
31
31
  # it_should_have_a_nested_ordered_list_with_class('fragments-group')
32
32
  it_should_apply_error_logic_for_input_type(:datetime)
33
-
33
+
34
34
  it 'should have a legend and label with the label text inside the fieldset' do
35
- output_buffer.should have_tag('form div.control-group.datetime-wrapper label.control-label', /Publish at/)
35
+ output_buffer.should have_tag('form div.clearfix.datetime label', /Publish at/)
36
36
  end
37
37
 
38
38
  # it 'should associate the legend label with the first select' do
@@ -41,7 +41,7 @@ describe 'datetime input' do
41
41
  # output_buffer.should have_tag('form li.datetime fieldset legend.label label[@for]')
42
42
  # output_buffer.should have_tag('form li.datetime fieldset legend.label label[@for="post_publish_at_1i"]')
43
43
  # end
44
-
44
+
45
45
  # it 'should have an ordered list of five items inside the fieldset' do
46
46
  # output_buffer.should have_tag('form li.datetime fieldset ol.fragments-group')
47
47
  # output_buffer.should have_tag('form li.datetime fieldset ol li.fragment', :count => 5)
@@ -55,26 +55,26 @@ describe 'datetime input' do
55
55
  # output_buffer.should have_tag('form li.datetime fieldset ol li label', /hour/i)
56
56
  # output_buffer.should have_tag('form li.datetime fieldset ol li label', /min/i)
57
57
  # end
58
-
58
+
59
59
  # it 'should have five selects' do
60
60
  # output_buffer.should have_tag('form li.datetime fieldset ol li select', :count => 5)
61
61
  # end
62
62
 
63
63
  it 'should have two inputs' do
64
- output_buffer.should have_tag('form div.control-group.datetime-wrapper div.controls input', :count => 2)
64
+ output_buffer.should have_tag('form div.clearfix.datetime div.input input', :count => 2)
65
65
  end
66
66
 
67
67
  end
68
68
 
69
69
  describe "when namespace is provided" do
70
-
70
+
71
71
  before do
72
72
  output_buffer.replace ''
73
73
  concat(semantic_form_for(@new_post, :namespace => "context2") do |builder|
74
74
  concat(builder.input(:publish_at, :as => :datetime))
75
75
  end)
76
76
  end
77
-
77
+
78
78
  it_should_have_input_wrapper_with_id("context2_post_publish_at_input")
79
79
  it_should_have_input_with_id("context2_post_publish_at[date]")
80
80
  it_should_have_input_with_id("context2_post_publish_at[time]")
@@ -83,12 +83,12 @@ describe 'datetime input' do
83
83
  # it_should_have_select_with_id("context2_post_publish_at_3i")
84
84
  # it_should_have_select_with_id("context2_post_publish_at_4i")
85
85
  # it_should_have_select_with_id("context2_post_publish_at_5i")
86
-
86
+
87
87
  end
88
88
 
89
89
  describe "when required" do
90
90
  it "should add the required attribute to the input's html options" do
91
- with_config :use_required_attribute, true do
91
+ with_config :use_required_attribute, true do
92
92
  concat(semantic_form_for(@new_post) do |builder|
93
93
  concat(builder.input(:title, :as => :datetime, :required => true))
94
94
  end)
@@ -97,5 +97,5 @@ describe 'datetime input' do
97
97
  end
98
98
  end
99
99
  end
100
-
100
+
101
101
  end
@@ -8,7 +8,7 @@ describe 'email input' do
8
8
  before do
9
9
  @output_buffer = ''
10
10
  mock_everything
11
- Formtastic::Helpers::FormHelper.builder = FormtasticBootstrap::FormBuilder
11
+ Formtastic::Helpers::FormHelper.builder = SpeedoFormstrap::FormBuilder
12
12
  end
13
13
 
14
14
  describe "when object is provided" do
@@ -18,8 +18,8 @@ describe 'email input' do
18
18
  end)
19
19
  end
20
20
 
21
- it_should_have_input_wrapper_with_class('email-wrapper')
22
- it_should_have_input_wrapper_with_class("control-group")
21
+ it_should_have_input_wrapper_with_class(:email)
22
+ it_should_have_input_wrapper_with_class(:clearfix)
23
23
  it_should_have_input_wrapper_with_class(:stringish)
24
24
  it_should_have_input_class_in_the_right_place
25
25
  it_should_have_input_wrapper_with_id("post_email_input")
@@ -43,38 +43,10 @@ describe 'email input' do
43
43
  it_should_have_label_and_input_with_id("context2_post_email")
44
44
 
45
45
  end
46
-
47
- describe "when index is provided" do
48
-
49
- before do
50
- @output_buffer = ''
51
- mock_everything
52
-
53
- concat(semantic_form_for(@new_post) do |builder|
54
- concat(builder.fields_for(:author, :index => 3) do |author|
55
- concat(author.input(:name, :as => :email))
56
- end)
57
- end)
58
- end
59
-
60
- it 'should index the id of the wrapper' do
61
- output_buffer.should have_tag("div#post_author_attributes_3_name_input")
62
- end
63
-
64
- it 'should index the id of the select tag' do
65
- output_buffer.should have_tag("input#post_author_attributes_3_name")
66
- end
67
-
68
- it 'should index the name of the select tag' do
69
- output_buffer.should have_tag("input[@name='post[author_attributes][3][name]']")
70
- end
71
-
72
- end
73
-
74
-
46
+
75
47
  describe "when required" do
76
48
  it "should add the required attribute to the input's html options" do
77
- with_config :use_required_attribute, true do
49
+ with_config :use_required_attribute, true do
78
50
  concat(semantic_form_for(@new_post) do |builder|
79
51
  concat(builder.input(:title, :as => :email, :required => true))
80
52
  end)
@@ -82,6 +54,6 @@ describe 'email input' do
82
54
  end
83
55
  end
84
56
  end
85
-
57
+
86
58
  end
87
59
 
@@ -8,15 +8,15 @@ describe 'file input' do
8
8
  before do
9
9
  @output_buffer = ''
10
10
  mock_everything
11
- Formtastic::Helpers::FormHelper.builder = FormtasticBootstrap::FormBuilder
11
+ Formtastic::Helpers::FormHelper.builder = SpeedoFormstrap::FormBuilder
12
12
 
13
13
  concat(semantic_form_for(@new_post) do |builder|
14
14
  concat(builder.input(:body, :as => :file))
15
15
  end)
16
16
  end
17
17
 
18
- it_should_have_input_wrapper_with_class("file-wrapper")
19
- it_should_have_input_wrapper_with_class("control-group")
18
+ it_should_have_input_wrapper_with_class("file")
19
+ it_should_have_input_wrapper_with_class(:clearfix)
20
20
  it_should_have_input_class_in_the_right_place
21
21
  it_should_have_input_wrapper_with_id("post_body_input")
22
22
  it_should_have_label_with_text(/Body/)
@@ -29,7 +29,7 @@ describe 'file input' do
29
29
  concat(semantic_form_for(@new_post) do |builder|
30
30
  concat(builder.input(:title, :as => :file, :input_html => { :class => 'myclass' }))
31
31
  end)
32
- output_buffer.should have_tag("form div.control-group div.controls input.myclass")
32
+ output_buffer.should have_tag("form div.clearfix div.input input.myclass")
33
33
  end
34
34
 
35
35
  describe "when namespace is provided" do
@@ -47,35 +47,7 @@ describe 'file input' do
47
47
  it_should_have_label_and_input_with_id("context2_post_body")
48
48
 
49
49
  end
50
-
51
- describe "when index is provided" do
52
-
53
- before do
54
- @output_buffer = ''
55
- mock_everything
56
-
57
- concat(semantic_form_for(@new_post) do |builder|
58
- concat(builder.fields_for(:author, :index => 3) do |author|
59
- concat(author.input(:name, :as => :file))
60
- end)
61
- end)
62
- end
63
-
64
- it 'should index the id of the wrapper' do
65
- output_buffer.should have_tag("div#post_author_attributes_3_name_input")
66
- end
67
-
68
- it 'should index the id of the select tag' do
69
- output_buffer.should have_tag("input#post_author_attributes_3_name")
70
- end
71
-
72
- it 'should index the name of the select tag' do
73
- output_buffer.should have_tag("input[@name='post[author_attributes][3][name]']")
74
- end
75
-
76
- end
77
-
78
-
50
+
79
51
  context "when required" do
80
52
  it "should add the required attribute to the input's html options" do
81
53
  with_config :use_required_attribute, true do
@@ -86,6 +58,6 @@ describe 'file input' do
86
58
  end
87
59
  end
88
60
  end
89
-
61
+
90
62
  end
91
63
 
@@ -8,7 +8,7 @@ describe 'hidden input' do
8
8
  before do
9
9
  @output_buffer = ''
10
10
  mock_everything
11
- Formtastic::Helpers::FormHelper.builder = FormtasticBootstrap::FormBuilder
11
+ Formtastic::Helpers::FormHelper.builder = SpeedoFormstrap::FormBuilder
12
12
 
13
13
  concat(semantic_form_for(@new_post) do |builder|
14
14
  concat(builder.input(:secret, :as => :hidden))
@@ -19,37 +19,37 @@ describe 'hidden input' do
19
19
  end)
20
20
  end
21
21
 
22
- it_should_have_input_wrapper_with_class("hidden-wrapper")
23
- it_should_have_input_wrapper_with_class("control-group")
22
+ it_should_have_input_wrapper_with_class("hidden")
23
+ it_should_have_input_wrapper_with_class(:clearfix)
24
24
  it_should_have_input_class_in_the_right_place
25
25
  it_should_have_input_wrapper_with_id("post_secret_input")
26
26
  it_should_not_have_a_label
27
27
 
28
28
  it "should generate a input field" do
29
- output_buffer.should have_tag("form div.control-group div.controls input#post_secret")
30
- output_buffer.should have_tag("form div.control-group div.controls input#post_secret[@type=\"hidden\"]")
31
- output_buffer.should have_tag("form div.control-group div.controls input#post_secret[@name=\"post[secret]\"]")
29
+ output_buffer.should have_tag("form div.clearfix div.input input#post_secret")
30
+ output_buffer.should have_tag("form div.clearfix div.input input#post_secret[@type=\"hidden\"]")
31
+ output_buffer.should have_tag("form div.clearfix div.input input#post_secret[@name=\"post[secret]\"]")
32
32
  end
33
33
 
34
34
  it "should get value from the object" do
35
- output_buffer.should have_tag("form div.control-group div.controls input#post_secret[@type=\"hidden\"][@value=\"1\"]")
35
+ output_buffer.should have_tag("form div.clearfix div.input input#post_secret[@type=\"hidden\"][@value=\"1\"]")
36
36
  end
37
-
37
+
38
38
  it "should pass any explicitly specified value - using :value" do
39
- output_buffer.should have_tag("form div.control-group div.controls input#post_author_id[@type=\"hidden\"][@value=\"99\"]")
39
+ output_buffer.should have_tag("form div.clearfix div.input input#post_author_id[@type=\"hidden\"][@value=\"99\"]")
40
40
  end
41
41
 
42
42
  # Handle Formtastic :input_html options for consistency.
43
43
  it "should pass any explicitly specified value - using :input_html options" do
44
- output_buffer.should have_tag("form div.control-group div.controls input#post_published[@type=\"hidden\"][@value=\"true\"]")
44
+ output_buffer.should have_tag("form div.clearfix div.input input#post_published[@type=\"hidden\"][@value=\"true\"]")
45
45
  end
46
46
 
47
47
  it "should pass any option specified using :input_html" do
48
- output_buffer.should have_tag("form div.control-group div.controls input#new_post_reviewer[@type=\"hidden\"][@class=\"new_post_reviewer\"]")
48
+ output_buffer.should have_tag("form div.clearfix div.input input#new_post_reviewer[@type=\"hidden\"][@class=\"new_post_reviewer\"]")
49
49
  end
50
50
 
51
51
  it "should prefer :input_html over directly supplied options" do
52
- output_buffer.should have_tag("form div.control-group div.controls input#post_author_id[@type=\"hidden\"][@value=\"formtastic_value\"]")
52
+ output_buffer.should have_tag("form div.clearfix div.input input#post_author_id[@type=\"hidden\"][@value=\"formtastic_value\"]")
53
53
  end
54
54
 
55
55
  it "should not render inline errors" do
@@ -99,35 +99,7 @@ describe 'hidden input' do
99
99
  end
100
100
 
101
101
  end
102
-
103
- describe "when index is provided" do
104
-
105
- before do
106
- @output_buffer = ''
107
- mock_everything
108
-
109
- concat(semantic_form_for(@new_post) do |builder|
110
- concat(builder.fields_for(:author, :index => 3) do |author|
111
- concat(author.input(:name, :as => :hidden))
112
- end)
113
- end)
114
- end
115
-
116
- it 'should index the id of the wrapper' do
117
- output_buffer.should have_tag("div#post_author_attributes_3_name_input")
118
- end
119
-
120
- it 'should index the id of the select tag' do
121
- output_buffer.should have_tag("input#post_author_attributes_3_name")
122
- end
123
-
124
- it 'should index the name of the select tag' do
125
- output_buffer.should have_tag("input[@name='post[author_attributes][3][name]']")
126
- end
127
-
128
- end
129
-
130
-
102
+
131
103
  context "when required" do
132
104
  it "should not add the required attribute to the input's html options" do
133
105
  concat(semantic_form_for(@new_post) do |builder|