Permalink
Browse files

Merge pull request #458 from derekprior/consistent-naming

Consistently refer to SimpleForm in docs and tests
  • Loading branch information...
2 parents 48ea550 + 2000d32 commit eaca9951c716f2fadf969be537ae53dbfeb1a01e @rafaelfranca rafaelfranca committed Feb 18, 2012
View
@@ -2,7 +2,7 @@
[![Build Status](https://secure.travis-ci.org/plataformatec/simple_form.png)](http://travis-ci.org/plataformatec/simple_form)
**SimpleForm** aims to be as flexible as possible while helping you with powerful components to create
-your forms. The basic goal of simple form is to not touch your way of defining the layout, letting
+your forms. The basic goal of SimpleForm is to not touch your way of defining the layout, letting
you find the better design for your eyes. Most of the DSL was inherited from Formtastic,
which we are thankful for and should make you feel right at home.
@@ -485,7 +485,7 @@ on `simple_form_for` helper. They are listed below.
### Simple Fields For
-Wrapper to use simple form inside a default rails form
+Wrapper to use SimpleForm inside a default rails form
```ruby
form_for @user do |f|
@@ -8,7 +8,7 @@ class InstallGenerator < Rails::Generators::Base
def info_bootstrap
return if options.bootstrap?
- puts "Simple Form 2 supports Twitter bootstrap. In case you want to " \
+ puts "SimpleForm 2 supports Twitter bootstrap. In case you want to " \
"generate bootstrap configuration, please re-run this " \
"generator passing --bootstrap as option."
end
@@ -171,6 +171,6 @@ SimpleForm.setup do |config|
# Automatically discover new inputs in Rails' autoload path.
# config.inputs_discovery = true
- # Cache simple form inputs discovery
+ # Cache SimpleForm inputs discovery
# config.cache_discovery = !Rails.env.development?
end
View
@@ -116,7 +116,7 @@ module SimpleForm
mattr_accessor :inputs_discovery
@@inputs_discovery = true
- # Cache simple form inputs discovery
+ # Cache SimpleForm inputs discovery
mattr_accessor :cache_discovery
@@cache_discovery = defined?(Rails) && !Rails.env.development?
@@ -207,7 +207,7 @@ def self.setup
yield self
unless @@deprecated.empty?
- raise "[SIMPLE FORM] Your simple form initializer file is using the following methods: #{@@deprecated.to_sentence}. " <<
+ raise "[SIMPLE FORM] Your SimpleForm initializer file is using the following methods: #{@@deprecated.to_sentence}. " <<
"Those methods are part of the outdated configuration API. Updating to the new API is easy and fast. " <<
"Check for more info here: https://github.com/plataformatec/simple_form/wiki/Upgrading-to-Simple-Form-2.0"
end
@@ -183,7 +183,7 @@ def collection_check_boxes(attribute, collection, value_method, text_method, opt
wrap_rendered_collection(rendered_collection + hidden, options)
end
- # Wrapper for using simple form inside a default rails form.
+ # Wrapper for using SimpleForm inside a default rails form.
# Example:
#
# form_for @user do |f|
@@ -1,6 +1,6 @@
module SimpleForm
module ActionViewExtensions
- # This module creates simple form wrappers around default form_for and fields_for.
+ # This module creates SimpleForm wrappers around default form_for and fields_for.
#
# Example:
#
@@ -2,23 +2,23 @@
class FormHelperTest < ActionView::TestCase
- test 'simple form for yields an instance of FormBuilder' do
+ test 'SimpleForm for yields an instance of FormBuilder' do
simple_form_for :user do |f|
assert f.instance_of?(SimpleForm::FormBuilder)
end
end
- test 'simple form should add default class to form' do
+ test 'SimpleForm should add default class to form' do
concat(simple_form_for(:user) do |f| end)
assert_select 'form.simple_form'
end
- test 'simple form should use default browser validations by default' do
+ test 'SimpleForm should use default browser validations by default' do
concat(simple_form_for(:user) do |f| end)
assert_no_select 'form[novalidate]'
end
- test 'simple form should not use default browser validations if specified in the configuration options' do
+ test 'SimpleForm should not use default browser validations if specified in the configuration options' do
swap SimpleForm, :browser_validations => false do
concat(simple_form_for(:user) do |f| end)
assert_select 'form[novalidate="novalidate"]'
@@ -37,49 +37,49 @@ class FormHelperTest < ActionView::TestCase
end
end
- test 'simple form should add object name as css class to form when object is not present' do
+ test 'SimpleForm should add object name as css class to form when object is not present' do
concat(simple_form_for(:user) do |f| end)
assert_select 'form.simple_form.user'
end
- test 'simple form should add :as option as css class to form when object is not present' do
+ test 'SimpleForm should add :as option as css class to form when object is not present' do
concat(simple_form_for(:user, :as => 'superuser') do |f| end)
assert_select 'form.simple_form.superuser'
end
- test 'simple form should add object class name with new prefix as css class to form if record is not persisted' do
+ test 'SimpleForm should add object class name with new prefix as css class to form if record is not persisted' do
@user.new_record!
concat(simple_form_for(@user) do |f| end)
assert_select 'form.simple_form.new_user'
end
- test 'simple form should add :as option with new prefix as css class to form if record is not persisted' do
+ test 'SimpleForm should add :as option with new prefix as css class to form if record is not persisted' do
@user.new_record!
concat(simple_form_for(@user, :as => 'superuser') do |f| end)
assert_select 'form.simple_form.new_superuser'
end
- test 'simple form should add edit class prefix as css class to form if record is persisted' do
+ test 'SimpleForm should add edit class prefix as css class to form if record is persisted' do
concat(simple_form_for(@user) do |f| end)
assert_select 'form.simple_form.edit_user'
end
- test 'simple form should add :as options with edit prefix as css class to form if record is persisted' do
+ test 'SimpleForm should add :as options with edit prefix as css class to form if record is persisted' do
concat(simple_form_for(@user, :as => 'superuser') do |f| end)
assert_select 'form.simple_form.edit_superuser'
end
- test 'simple form should not add object class to form if css_class is specified' do
+ test 'SimpleForm should not add object class to form if css_class is specified' do
concat(simple_form_for(:user, :html => {:class => nil}) do |f| end)
assert_no_select 'form.user'
end
- test 'simple form should add custom class to form if css_class is specified' do
+ test 'SimpleForm should add custom class to form if css_class is specified' do
concat(simple_form_for(:user, :html => {:class => 'my_class'}) do |f| end)
assert_select 'form.my_class'
end
- test 'pass options to simple form' do
+ test 'pass options to SimpleForm' do
concat(simple_form_for(:user, :url => '/account', :html => { :id => 'my_form' }) do |f| end)
assert_select 'form#my_form'
assert_select 'form[action=/account]'
@@ -9,7 +9,7 @@ class PriorityInputTest < ActionView::TestCase
assert_no_select 'select option[value=][disabled=disabled]'
end
- test 'input should generate a country select with simple form default' do
+ test 'input should generate a country select with SimpleForm default' do
swap SimpleForm, :country_priority => [ 'Brazil' ] do
with_input_for @user, :country, :country
assert_select 'select option[value=][disabled=disabled]'
@@ -4,7 +4,7 @@
class StringInputTest < ActionView::TestCase
test 'input should map text field to string attribute' do
with_input_for @user, :name, :string
- assert_select "input#user_name[type=text][name='user[name]'][value=New in Simple Form!]"
+ assert_select "input#user_name[type=text][name='user[name]'][value=New in SimpleForm!]"
end
test 'input should generate a password field for password attributes' do
View
@@ -51,14 +51,14 @@ def set_response
def setup_new_user(options={})
@user = User.new({
:id => 1,
- :name => 'New in Simple Form!',
+ :name => 'New in SimpleForm!',
:description => 'Hello!',
:created_at => Time.now
}.merge(options))
@validating_user = ValidatingUser.new({
:id => 1,
- :name => 'New in Simple Form!',
+ :name => 'New in SimpleForm!',
:description => 'Hello!',
:home_picture => 'Home picture',
:created_at => Time.now,
@@ -70,7 +70,7 @@ def setup_new_user(options={})
@other_validating_user = OtherValidatingUser.new({
:id => 1,
- :name => 'New in Simple Form!',
+ :name => 'New in SimpleForm!',
:description => 'Hello!',
:created_at => Time.now,
:age => 19,

0 comments on commit eaca995

Please sign in to comment.