Sha256: 284f14c47b19007d4c95c6f8acd5171221b0af6559f28cfb8e3f5737456f69ba
Contents?: true
Size: 814 Bytes
Versions: 14
Compression:
Stored size: 814 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../test_helper') require File.expand_path(File.dirname(__FILE__) + '/../data/models') class TranlationClassTest < ActiveSupport::TestCase def setup reset_db! end test 'defines a Translation class nested in the model class' do assert Post.const_defined?(:Translation) end test 'defines a belongs_to association' do assert_belongs_to Post::Translation, :post end test 'defines a reader for :locale that always returns a symbol' do post = Post::Translation.new post.write_attribute('locale', 'de') assert_equal :de, post.locale end test 'defines a write for :locale that always writes a string' do post = Post::Translation.new post.locale = :de assert_equal 'de', post.read_attribute('locale') end end
Version data entries
14 entries across 14 versions & 2 rubygems