formtastic 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/formtastic.rb +1 -1
  2. data/spec/defaults_spec.rb +20 -0
  3. metadata +4 -2
data/lib/formtastic.rb CHANGED
@@ -8,7 +8,7 @@ module Formtastic #:nodoc:
8
8
  @@default_text_field_size = 50
9
9
  @@all_fields_required_by_default = true
10
10
  @@include_blank_for_select_by_default = true
11
- @@required_string = proc { %{<abbr title="#{::Formtastic::I18n.t 'formtastic.required', :default => 'required'}">*</abbr>} }
11
+ @@required_string = proc { %{<abbr title="#{::Formtastic::I18n.t(:required)}">*</abbr>} }
12
12
  @@optional_string = ''
13
13
  @@inline_errors = :sentence
14
14
  @@label_str_method = :humanize
@@ -0,0 +1,20 @@
1
+ # coding: utf-8
2
+ require File.join(File.dirname(__FILE__), *%w[spec_helper])
3
+
4
+ describe 'Formtastic::SemanticFormBuilder-defaults' do
5
+
6
+ # Note: This spec might make better sense somewhere else. Just temporary.
7
+
8
+ describe "required string" do
9
+
10
+ it "should render proc with I18n correctly" do
11
+ ::I18n.backend.store_translations :en, :formtastic => {:required => 'Haha!'}
12
+
13
+ required_string = Formtastic::SemanticFormBuilder.required_string
14
+ required_string = required_string.is_a?(::Proc) ? required_string.call : required_string.to_s
15
+ required_string.should == %{<abbr title="Haha!">*</abbr>}
16
+ end
17
+
18
+ end
19
+
20
+ end
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: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin French
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-23 00:00:00 +11:00
12
+ date: 2009-11-24 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -91,6 +91,7 @@ files:
91
91
  - spec/commit_button_spec.rb
92
92
  - spec/custom_builder_spec.rb
93
93
  - spec/custom_macros.rb
94
+ - spec/defaults_spec.rb
94
95
  - spec/error_proc_spec.rb
95
96
  - spec/errors_spec.rb
96
97
  - spec/form_helper_spec.rb
@@ -150,6 +151,7 @@ test_files:
150
151
  - spec/commit_button_spec.rb
151
152
  - spec/custom_builder_spec.rb
152
153
  - spec/custom_macros.rb
154
+ - spec/defaults_spec.rb
153
155
  - spec/error_proc_spec.rb
154
156
  - spec/errors_spec.rb
155
157
  - spec/form_helper_spec.rb