Permalink
Browse files

Add spec for custom_namespace error

When building a large number of forms in a threaded environment, 
I see the following error.

"undefined method `custom_namespace' for Formtastic::FormBuilder:Class"
  • Loading branch information...
1 parent 89b6030 commit d3131aa758ab23a02c274eba77bf6a66ad261383 @hudson-gev-art committed Feb 28, 2014
Showing with 15 additions and 0 deletions.
  1. +15 −0 spec/helpers/form_helper_spec.rb
@@ -192,4 +192,19 @@ class MyAwesomeCustomBuilder < Formtastic::FormBuilder
end
end
end
+
+ describe "Threaded Form Building" do
+ it "creates forms and adds an input in a threaded environment" do
+ threads = Array.new(1000).map{ Thread.new{create_form()} }
+ threads.map{ |t| t.join }
+ end
+
+ # Create the semantic form. Create the author input
+ def create_form
+ semantic_form_for(@new_post, :url => '/hello') do |builder|
+ input = builder.input :author
+ end
+ end
+ end
+
end

0 comments on commit d3131aa

Please sign in to comment.