aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2012-03-02 23:20:17 -0500
committerGuillermo Iguaran <guilleiguaran@gmail.com>2012-03-02 23:59:55 -0500
commit3b822e91d1a6c4eab0064989bbd07aae3a6d0d08 (patch)
treeaf57a545ec7ea8a735f1eea6b70804c275b48c23 /activemodel/test/cases
parent14f06dd8711231157435282cb288728c5f643303 (diff)
downloadrails-3b822e91d1a6c4eab0064989bbd07aae3a6d0d08.tar.gz
rails-3b822e91d1a6c4eab0064989bbd07aae3a6d0d08.tar.bz2
rails-3b822e91d1a6c4eab0064989bbd07aae3a6d0d08.zip
Add ActiveModel::Model, a mixin to make Ruby objects to work with AP inmediatly
Diffstat (limited to 'activemodel/test/cases')
-rw-r--r--activemodel/test/cases/model_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/activemodel/test/cases/model_test.rb b/activemodel/test/cases/model_test.rb
new file mode 100644
index 0000000000..d3e00b044f
--- /dev/null
+++ b/activemodel/test/cases/model_test.rb
@@ -0,0 +1,19 @@
+require 'cases/helper'
+
+class ModelTest < ActiveModel::TestCase
+ include ActiveModel::Lint::Tests
+
+ class BasicModel
+ include ActiveModel::Model
+ attr_accessor :attr
+ end
+
+ def setup
+ @model = BasicModel.new
+ end
+
+ def test_initialize_with_params
+ object = BasicModel.new(:attr => "value")
+ assert_equal object.attr, "value"
+ end
+end