formtastic 2.3.0.rc2 → 2.3.0.rc3

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 (50) hide show
  1. data/.travis.yml +27 -1
  2. data/Appraisals +5 -0
  3. data/CHANGELOG +1 -0
  4. data/README.textile +19 -26
  5. data/formtastic.gemspec +4 -3
  6. data/gemfiles/rails_3.0.gemfile +1 -1
  7. data/gemfiles/rails_3.1.gemfile +1 -1
  8. data/gemfiles/rails_3.2.gemfile +1 -1
  9. data/gemfiles/rails_4.0.4.gemfile +7 -0
  10. data/gemfiles/rails_4.gemfile +1 -1
  11. data/lib/formtastic/form_builder.rb +9 -1
  12. data/lib/formtastic/helpers/form_helper.rb +11 -6
  13. data/lib/formtastic/helpers/inputs_helper.rb +6 -1
  14. data/lib/formtastic/inputs/base/collections.rb +1 -1
  15. data/lib/formtastic/inputs/base/validations.rb +1 -1
  16. data/lib/formtastic/inputs/boolean_input.rb +4 -14
  17. data/lib/formtastic/inputs/check_boxes_input.rb +7 -1
  18. data/lib/formtastic/inputs/radio_input.rb +2 -0
  19. data/lib/formtastic/util.rb +13 -1
  20. data/lib/formtastic/version.rb +1 -1
  21. data/lib/generators/templates/_form.html.slim +2 -2
  22. data/lib/generators/templates/formtastic.rb +15 -1
  23. data/spec/actions/generic_action_spec.rb +3 -3
  24. data/spec/builder/custom_builder_spec.rb +7 -7
  25. data/spec/builder/semantic_fields_for_spec.rb +8 -8
  26. data/spec/generators/formtastic/form/form_generator_spec.rb +6 -6
  27. data/spec/helpers/action_helper_spec.rb +11 -11
  28. data/spec/helpers/form_helper_spec.rb +22 -11
  29. data/spec/helpers/input_helper_spec.rb +44 -44
  30. data/spec/helpers/inputs_helper_spec.rb +64 -31
  31. data/spec/helpers/semantic_errors_helper_spec.rb +12 -12
  32. data/spec/i18n_spec.rb +5 -5
  33. data/spec/inputs/boolean_input_spec.rb +6 -5
  34. data/spec/inputs/check_boxes_input_spec.rb +27 -9
  35. data/spec/inputs/country_input_spec.rb +5 -5
  36. data/spec/inputs/custom_input_spec.rb +1 -1
  37. data/spec/inputs/date_picker_input_spec.rb +4 -4
  38. data/spec/inputs/datetime_picker_input_spec.rb +4 -4
  39. data/spec/inputs/hidden_input_spec.rb +3 -3
  40. data/spec/inputs/include_blank_spec.rb +2 -2
  41. data/spec/inputs/number_input_spec.rb +36 -36
  42. data/spec/inputs/radio_input_spec.rb +23 -5
  43. data/spec/inputs/range_input_spec.rb +19 -19
  44. data/spec/inputs/select_input_spec.rb +40 -20
  45. data/spec/inputs/string_input_spec.rb +2 -2
  46. data/spec/inputs/time_picker_input_spec.rb +4 -4
  47. data/spec/localizer_spec.rb +1 -1
  48. data/spec/spec_helper.rb +203 -188
  49. data/spec/support/custom_macros.rb +8 -8
  50. metadata +15 -13
@@ -162,7 +162,7 @@ module CustomMacros
162
162
  def it_should_use_column_size_for_columns_shorter_than_default_text_field_size(as)
163
163
  it 'should use the column size for columns shorter than default_text_field_size' do
164
164
  column_limit_shorted_than_default = 1
165
- @new_post.stub!(:column_for_attribute).and_return(mock('column', :type => as, :limit => column_limit_shorted_than_default))
165
+ @new_post.stub(:column_for_attribute).and_return(double('column', :type => as, :limit => column_limit_shorted_than_default))
166
166
 
167
167
  concat(semantic_form_for(@new_post) do |builder|
168
168
  concat(builder.input(:title, :as => as))
@@ -176,12 +176,12 @@ module CustomMacros
176
176
  describe 'when there are errors on the object for this method' do
177
177
  before do
178
178
  @title_errors = ['must not be blank', 'must be longer than 10 characters', 'must be awesome']
179
- @errors = mock('errors')
180
- @errors.stub!(:[]).with(errors_matcher(:title)).and_return(@title_errors)
179
+ @errors = double('errors')
180
+ @errors.stub(:[]).with(errors_matcher(:title)).and_return(@title_errors)
181
181
  Formtastic::FormBuilder.file_metadata_suffixes.each do |suffix|
182
- @errors.stub!(:[]).with(errors_matcher("title_#{suffix}".to_sym)).and_return(nil)
182
+ @errors.stub(:[]).with(errors_matcher("title_#{suffix}".to_sym)).and_return(nil)
183
183
  end
184
- @new_post.stub!(:errors).and_return(@errors)
184
+ @new_post.stub(:errors).and_return(@errors)
185
185
  end
186
186
 
187
187
  it 'should apply an errors class to the list item' do
@@ -299,7 +299,7 @@ module CustomMacros
299
299
 
300
300
  if as == :radio
301
301
  it 'should generate a sanitized label for attribute' do
302
- @bob.stub!(:category_name).and_return(@categories)
302
+ @bob.stub(:category_name).and_return(@categories)
303
303
  concat(semantic_form_for(@new_post) do |builder|
304
304
  fields = builder.semantic_fields_for(@bob) do |bob_builder|
305
305
  concat(bob_builder.input(:category_name, :as => as, :collection => @categories))
@@ -456,8 +456,8 @@ module CustomMacros
456
456
 
457
457
  describe "when the collection objects respond to #{label_method}" do
458
458
  before do
459
- @fred.stub!(:respond_to?).and_return { |m| m.to_s == label_method || m.to_s == 'id' }
460
- [@fred, @bob].each { |a| a.stub!(label_method).and_return('The Label Text') }
459
+ @fred.stub(:respond_to?).and_return { |m| m.to_s == label_method || m.to_s == 'id' }
460
+ [@fred, @bob].each { |a| a.stub(label_method).and_return('The Label Text') }
461
461
 
462
462
  concat(semantic_form_for(@new_post) do |builder|
463
463
  concat(builder.input(:author, :as => as))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formtastic
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0.rc2
4
+ version: 2.3.0.rc3
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-10 00:00:00.000000000 Z
12
+ date: 2014-04-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: 2.12.0
53
+ version: 2.14.0
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 2.12.0
61
+ version: 2.14.0
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: rspec_tag_matchers
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -176,33 +176,33 @@ dependencies:
176
176
  requirement: !ruby/object:Gem::Requirement
177
177
  none: false
178
178
  requirements:
179
- - - ! '>='
179
+ - - '='
180
180
  - !ruby/object:Gem::Version
181
- version: '0'
181
+ version: 1.0.0.beta3
182
182
  type: :development
183
183
  prerelease: false
184
184
  version_requirements: !ruby/object:Gem::Requirement
185
185
  none: false
186
186
  requirements:
187
- - - ! '>='
187
+ - - '='
188
188
  - !ruby/object:Gem::Version
189
- version: '0'
189
+ version: 1.0.0.beta3
190
190
  - !ruby/object:Gem::Dependency
191
191
  name: rake
192
192
  requirement: !ruby/object:Gem::Requirement
193
193
  none: false
194
194
  requirements:
195
- - - ! '>='
195
+ - - <=
196
196
  - !ruby/object:Gem::Version
197
- version: '0'
197
+ version: 10.1.1
198
198
  type: :development
199
199
  prerelease: false
200
200
  version_requirements: !ruby/object:Gem::Requirement
201
201
  none: false
202
202
  requirements:
203
- - - ! '>='
203
+ - - <=
204
204
  - !ruby/object:Gem::Version
205
- version: '0'
205
+ version: 10.1.1
206
206
  - !ruby/object:Gem::Dependency
207
207
  name: activemodel
208
208
  requirement: !ruby/object:Gem::Requirement
@@ -246,6 +246,7 @@ files:
246
246
  - gemfiles/rails_3.0.gemfile
247
247
  - gemfiles/rails_3.1.gemfile
248
248
  - gemfiles/rails_3.2.gemfile
249
+ - gemfiles/rails_4.0.4.gemfile
249
250
  - gemfiles/rails_4.gemfile
250
251
  - gemfiles/rails_edge.gemfile
251
252
  - lib/formtastic.rb
@@ -384,7 +385,8 @@ files:
384
385
  - spec/support/deprecation.rb
385
386
  - spec/support/test_environment.rb
386
387
  homepage: http://github.com/justinfrench/formtastic
387
- licenses: []
388
+ licenses:
389
+ - MIT
388
390
  post_install_message:
389
391
  rdoc_options:
390
392
  - --charset=UTF-8