Sha256: f90deaafd3028f4268f4bc413658252b1c931ac3c10eb1e9a172ff28af314c40
Contents?: true
Size: 486 Bytes
Versions: 12
Compression:
Stored size: 486 Bytes
Contents
require 'test_helper' class Superstore::Associations::HasManyTest < Superstore::TestCase class TestObject < Issue end test 'has_many' do issue = TestObject.create! label = Label.create! name: 'important', issue_id: issue.id assert_equal [label], issue.labels end test 'create supports preloaded records' do issue = TestObject.create! issue.labels = Label.all.to_a issue.labels.create! name: 'blue' assert_equal 1, issue.labels.size end end
Version data entries
12 entries across 12 versions & 1 rubygems