Sha256: 730b08cb26d3188a9b9b18650811715f26b27254b65b39d306470844e8cfdc3a
Contents?: true
Size: 1.09 KB
Versions: 2
Compression:
Stored size: 1.09 KB
Contents
require 'cases/helper' require 'models/admin' require 'models/admin/user' class StoreTest < ActiveRecord::TestCase setup do @john = Admin::User.create(:name => 'John Doe', :color => 'black', :remember_login => true) end test "reading store attributes through accessors" do assert_equal 'black', @john.color assert_nil @john.homepage end test "writing store attributes through accessors" do @john.color = 'red' @john.homepage = '37signals.com' assert_equal 'red', @john.color assert_equal '37signals.com', @john.homepage end test "accessing attributes not exposed by accessors" do @john.settings[:icecream] = 'graeters' @john.save assert_equal 'graeters', @john.reload.settings[:icecream] end test "updating the store will mark it as changed" do @john.color = 'red' assert @john.settings_changed? end test "object initialization with not nullable column" do assert_equal true, @john.remember_login end test "writing with not nullable column" do @john.remember_login = false assert_equal false, @john.remember_login end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
activerecord-nuodb-adapter-2.0.3 | test/cases/store_test.rb |
activerecord-nuodb-adapter-2.0 | test/cases/store_test.rb |