aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/lib/controller/fake_models.rb
Commit message (Collapse)AuthorAgeFilesLines
* DRY fake models for testingAkira Matsuda2017-02-021-2/+6
|
* class Foo < Struct.new(:x) creates an extra unneeded anonymous classAkira Matsuda2017-01-131-5/+4
| | | | because Struct.new returns a Class, we just can give it a name and use it directly without inheriting from it
* Generate indexed names in input even when objects are not persistedRafael Mendonça França2017-01-031-4/+4
| | | | | | | | | | | | | | When you ask to generate multiple nested inputs using: field_for('comments[]', Comment.new) do |c| c.text_field :body Rails should generated the names like `post[comments][][body]`. To make sure we don't have regression the fake models now use the same implementation of `#to_param` as `ActiveRecord::Base` Fixes #26942
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-2/+2
|
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+0
|
* applies new string literal convention in actionview/testXavier Noria2016-08-061-1/+1
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Revert "Merge pull request #22764 from ↵Rafael Mendonça França2016-03-051-21/+0
| | | | | | | | | | stevenspiel/titleize_model_name_for_default_submit_button_value" This reverts commit 4158974c60d817c9bc1e2aecb342161295f2ac0d, reversing changes made to 3d590add45b7ff1de972d99b076cb504d5208935. Reason: This break i18n in some languages. See https://github.com/rails/rails/issues/791#issuecomment-192724640
* Suppress warning (instance variable @persisted not initialized)yui-knk2016-01-071-0/+1
|
* downcase default submit button value's model nameSteven Spiel2016-01-011-0/+20
|
* Add tests to make sure label and placeholder respect to_modelRafael Mendonça França2015-02-051-0/+16
|
* Better tests for AV::RecordIdentifierclaudiob2014-12-231-0/+12
| | | | | | | | | | | | | | | | | This commit intends to clarify the scope of ActionView::RecordIdentifier methods `dom_id` and `dom_class`. Most of the current documentation comes from da257eb8 (7 years ago) when the decoupling of ActionView, ActiveRecord and ActiveModel was not a concern. Since then, steps have been taken to reach such decoupling. Therefore I think it's important to show that ActionView::RecordIdentifier **does not strictly depend on the ActiveRecord API**: any class `Post` implementing `post.to_key` and `post.model_name.param_key` will work. This commit adds a test to prove that ActionView::RecordIdentifier methods can also be used on objects that do not subclass ActiveRecord::Base.
* Remove unused Sheep fixture from AVclaudiob2014-12-221-13/+0
| | | | | | | | The `Sheep` fixture was added in eb23754e when moving template tests from actionpack to actionview, but it's not actually used in ActionView tests. The `Sheep` fixture is only used to test `uncountable` in ActiveModel tests, and is already defined in activemodel/test/models/sheep.rb
* Remove unneeded filesPiotr Sarnacki2013-06-201-34/+0
|
* Move template tests from actionpack to actionviewPiotr Sarnacki2013-06-201-0/+219