justinfrench/formtastic — pull request #921 by mikz (2013-02-21 11:12:24+00:00)
Title: Add support for namespaced input classes

Hi there!
First things first - thank you for this awesome project.

I found that using global namespace for custom inputs does not fit our applications, so I made this patch which allows you to namespace custom inputs into custom namespace (form builder class by default).

for example:
```ruby
class CustomFormBuilder < Formtastic::FormBuilder
class StringInput < Formtastic::Inputs::StringInput
end
end
```
Will use CustomFormBuilder::StringInput instead of formtastic one.

To not break backwards compatibility top level ones are still used first.

Also in the process when writing tests I found out that input helper was not tested for cases when input_classes are on/off so I refactored tests to shared example and let it run for both cases.

Also when doing it I set up some basic mock objects so input helper test can be ran without whole form builder which makes the tests much simpler.

* namespaced input classes can be in form builder namespace
* the namespace can be overridden in the form builder
* upgrade RSpec to get constant stubbing and other goodness
* refactor part of input helper spec
* to test behaviour when cache_classes is on/off
* to not rely on form generation