active_type 0.4.5 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rspec +1 -0
  4. data/.travis.yml +30 -24
  5. data/CHANGELOG.md +73 -2
  6. data/README.md +56 -11
  7. data/Rakefile +22 -1
  8. data/active_type.gemspec +2 -1
  9. data/gemfiles/Gemfile.3.2.mysql2 +1 -0
  10. data/gemfiles/Gemfile.3.2.mysql2.lock +4 -2
  11. data/gemfiles/Gemfile.3.2.sqlite3 +1 -0
  12. data/gemfiles/Gemfile.3.2.sqlite3.lock +4 -2
  13. data/gemfiles/Gemfile.4.0.sqlite3 +1 -0
  14. data/gemfiles/Gemfile.4.0.sqlite3.lock +4 -2
  15. data/gemfiles/Gemfile.4.1.sqlite3 +1 -0
  16. data/gemfiles/Gemfile.4.1.sqlite3.lock +4 -2
  17. data/gemfiles/Gemfile.4.2.1.mysql2 +1 -0
  18. data/gemfiles/Gemfile.4.2.1.mysql2.lock +4 -2
  19. data/gemfiles/Gemfile.4.2.1.pg +1 -0
  20. data/gemfiles/Gemfile.4.2.1.pg.lock +4 -2
  21. data/gemfiles/Gemfile.4.2.1.sqlite3 +1 -0
  22. data/gemfiles/Gemfile.4.2.1.sqlite3.lock +4 -2
  23. data/gemfiles/Gemfile.5.0.0.mysql2.lock +56 -0
  24. data/gemfiles/Gemfile.5.0.0.pg.lock +56 -0
  25. data/gemfiles/Gemfile.5.0.0.sqlite3 +8 -0
  26. data/gemfiles/Gemfile.5.0.0.sqlite3.lock +56 -0
  27. data/gemfiles/Gemfile.5.1.0.mysql2 +8 -0
  28. data/gemfiles/Gemfile.5.1.0.mysql2.lock +56 -0
  29. data/gemfiles/Gemfile.5.1.0.pg +8 -0
  30. data/gemfiles/Gemfile.5.1.0.pg.lock +56 -0
  31. data/gemfiles/Gemfile.5.1.0.sqlite3 +8 -0
  32. data/gemfiles/Gemfile.5.1.0.sqlite3.lock +56 -0
  33. data/lib/active_type/extended_record/inheritance.rb +41 -6
  34. data/lib/active_type/nested_attributes/association.rb +13 -4
  35. data/lib/active_type/nested_attributes/builder.rb +3 -3
  36. data/lib/active_type/nested_attributes/nests_many_association.rb +5 -1
  37. data/lib/active_type/nested_attributes/nests_one_association.rb +3 -2
  38. data/lib/active_type/no_table.rb +129 -42
  39. data/lib/active_type/type_caster.rb +66 -25
  40. data/lib/active_type/util.rb +21 -6
  41. data/lib/active_type/version.rb +1 -1
  42. data/lib/active_type/virtual_attributes.rb +23 -1
  43. data/lib/active_type.rb +13 -3
  44. metadata +16 -55
  45. data/spec/active_type/extended_record/single_table_inheritance_spec.rb +0 -62
  46. data/spec/active_type/extended_record_spec.rb +0 -233
  47. data/spec/active_type/nested_attributes_spec.rb +0 -700
  48. data/spec/active_type/object_spec.rb +0 -400
  49. data/spec/active_type/record_spec.rb +0 -236
  50. data/spec/active_type/util_spec.rb +0 -128
  51. data/spec/integration/holidays_spec.rb +0 -102
  52. data/spec/integration/shape_spec.rb +0 -110
  53. data/spec/integration/sign_in_spec.rb +0 -101
  54. data/spec/integration/sign_up_spec.rb +0 -102
  55. data/spec/shared_examples/accessors.rb +0 -41
  56. data/spec/shared_examples/belongs_to.rb +0 -17
  57. data/spec/shared_examples/coercible_columns.rb +0 -228
  58. data/spec/shared_examples/constructor.rb +0 -30
  59. data/spec/shared_examples/defaults.rb +0 -60
  60. data/spec/shared_examples/dirty_tracking.rb +0 -40
  61. data/spec/shared_examples/dupable.rb +0 -31
  62. data/spec/shared_examples/mass_assignment.rb +0 -26
  63. data/spec/spec_helper.rb +0 -27
  64. data/spec/support/database.rb +0 -55
  65. data/spec/support/database.sample.yml +0 -3
  66. data/spec/support/error_on.rb +0 -12
  67. data/spec/support/i18n.rb +0 -1
  68. data/spec/support/protected_params.rb +0 -20
  69. data/spec/support/time_zone.rb +0 -1
@@ -1,400 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module ObjectSpec
4
-
5
- class Object < ActiveType::Object
6
-
7
- attribute :virtual_string, :string
8
- attribute :virtual_integer, :integer
9
- attribute :virtual_time, :datetime
10
- attribute :virtual_date, :date
11
- attribute :virtual_boolean, :boolean
12
- attribute :virtual_attribute
13
-
14
- end
15
-
16
- class PlainObject < ActiveType::Object
17
- end
18
-
19
-
20
- class ObjectWithValidations < Object
21
-
22
- validates :virtual_string, :presence => true
23
- validates :virtual_boolean, :presence => true
24
-
25
- end
26
-
27
-
28
- class ObjectWithOverrides < Object
29
-
30
- attribute :overridable_test, :string
31
-
32
- def overridable_test
33
- super + super
34
- end
35
-
36
- end
37
-
38
-
39
- class InheritingObject < Object
40
- attribute :another_virtual_string, :string
41
- end
42
-
43
-
44
- class IncludingObject < Object
45
-
46
- module Module
47
- extend ActiveSupport::Concern
48
-
49
- included do
50
- attribute :another_virtual_string, :string
51
- end
52
- end
53
-
54
- include Module
55
- end
56
-
57
-
58
- class ObjectWithCallbacks < Object
59
-
60
- before_save :before_save_callback
61
- before_validation :before_validation_callback
62
- after_save :after_save_callback
63
- after_commit :after_commit_callback
64
-
65
- def before_save_callback
66
- end
67
-
68
- def before_validation_callback
69
- end
70
-
71
- def after_save_callback
72
- end
73
-
74
- def after_commit_callback
75
- end
76
-
77
- end
78
-
79
- class Child < ActiveRecord::Base
80
- end
81
-
82
- class ObjectWithBelongsTo < Object
83
-
84
- attribute :child_id, :integer
85
-
86
- belongs_to :child
87
-
88
- end
89
-
90
- class ObjectWithUnsupportedTypes < Object
91
- attribute :virtual_array, :array
92
- attribute :virtual_hash, :hash
93
- end
94
-
95
- end
96
-
97
-
98
- describe ActiveType::Object do
99
-
100
- subject { ObjectSpec::Object.new }
101
-
102
- describe 'constructors' do
103
- subject { ObjectSpec::Object }
104
-
105
- it_should_behave_like 'ActiveRecord-like constructors', { :virtual_string => "string", :virtual_integer => 100, :virtual_time => Time.now, :virtual_date => Date.today, :virtual_boolean => true }
106
-
107
- end
108
-
109
- describe 'mass assignment' do
110
- it_should_behave_like 'ActiveRecord-like mass assignment', { :virtual_string => "string", :virtual_integer => 100, :virtual_time => Time.now, :virtual_date => Date.today, :virtual_boolean => true }
111
- end
112
-
113
- describe 'accessors' do
114
- it_should_behave_like 'ActiveRecord-like accessors', { :virtual_string => "string", :virtual_integer => 100, :virtual_time => Time.now, :virtual_date => Date.today, :virtual_boolean => true }
115
- end
116
-
117
- describe 'unsupported types' do
118
- subject { ObjectSpec::ObjectWithUnsupportedTypes.new }
119
-
120
- it_should_behave_like 'ActiveRecord-like mass assignment', { :virtual_hash => {'foo' => 'bar'}, :virtual_array => ['foo', 'bar'] }
121
- it_should_behave_like 'ActiveRecord-like accessors', { :virtual_hash => {'foo' => 'bar'}, :virtual_array => ['foo', 'bar'] }
122
- end
123
-
124
- describe 'overridable attributes' do
125
- subject { ObjectSpec::ObjectWithOverrides.new }
126
-
127
- it 'is possible to override attributes with super' do
128
- subject.overridable_test = "test"
129
-
130
- expect(subject.overridable_test).to eq("testtest")
131
- end
132
- end
133
-
134
- describe 'attribute name validation' do
135
- it 'crashes when trying to define an invalid attribute name' do
136
- klass = Class.new(ActiveType::Object)
137
- expect {
138
- klass.class_eval do
139
- attribute :"<attr>", :string
140
- end
141
- }.to raise_error(ActiveType::InvalidAttributeNameError)
142
- end
143
- end
144
-
145
- context 'coercible' do
146
- describe 'string columns' do
147
- it_should_behave_like 'a coercible string column', :virtual_string
148
- end
149
-
150
- describe 'integer columns' do
151
- it_should_behave_like 'a coercible integer column', :virtual_integer
152
- end
153
-
154
- describe 'date columns' do
155
- it_should_behave_like 'a coercible date column', :virtual_date
156
- end
157
-
158
- describe 'time columns' do
159
- it_should_behave_like 'a coercible time column', :virtual_time
160
- end
161
-
162
- describe 'boolean columns' do
163
- it_should_behave_like 'a coercible boolean column', :virtual_boolean
164
- end
165
-
166
- describe 'untyped columns' do
167
- it_should_behave_like 'an untyped column', :virtual_attribute
168
- end
169
- end
170
-
171
- describe 'query methods' do
172
-
173
- it 'returns true for true' do
174
- subject.virtual_attribute = true
175
-
176
- expect(subject.virtual_attribute?).to eq(true)
177
- end
178
-
179
- it 'returns false for false' do
180
- subject.virtual_attribute = false
181
-
182
- expect(subject.virtual_attribute?).to eq(false)
183
- end
184
-
185
- it 'returns false for nil' do
186
- subject.virtual_attribute = nil
187
-
188
- expect(subject.virtual_attribute?).to eq(false)
189
- end
190
-
191
- it 'returns true for 1' do
192
- subject.virtual_attribute = 1
193
-
194
- expect(subject.virtual_attribute?).to eq(true)
195
- end
196
-
197
- it 'returns true for an object' do
198
- subject.virtual_attribute = Object.new
199
-
200
- expect(subject.virtual_attribute?).to eq(true)
201
- end
202
-
203
- end
204
-
205
- describe '#attributes' do
206
-
207
- it 'returns a hash of virtual attributes' do
208
- subject.virtual_string = "string"
209
- subject.virtual_integer = "17"
210
-
211
- expect(subject.attributes).to eq({
212
- "virtual_string" => "string",
213
- "virtual_integer" => 17,
214
- "virtual_time" => nil,
215
- "virtual_date" => nil,
216
- "virtual_boolean" => nil,
217
- "virtual_attribute" => nil,
218
- })
219
- end
220
-
221
- it 'also includes inherited attributes' do
222
- object = ObjectSpec::InheritingObject.new
223
- object.virtual_string = "string"
224
- object.virtual_integer = "17"
225
-
226
- expect(object.attributes).to eq({
227
- "virtual_string" => "string",
228
- "virtual_integer" => 17,
229
- "virtual_time" => nil,
230
- "virtual_date" => nil,
231
- "virtual_boolean" => nil,
232
- "virtual_attribute" => nil,
233
- "another_virtual_string" => nil,
234
- })
235
- end
236
-
237
- it 'also includes included attributes' do
238
- object = ObjectSpec::IncludingObject.new
239
- object.virtual_string = "string"
240
- object.virtual_integer = "17"
241
-
242
- expect(object.attributes).to eq({
243
- "virtual_string" => "string",
244
- "virtual_integer" => 17,
245
- "virtual_time" => nil,
246
- "virtual_date" => nil,
247
- "virtual_boolean" => nil,
248
- "virtual_attribute" => nil,
249
- "another_virtual_string" => nil,
250
- })
251
- end
252
-
253
- end
254
-
255
- describe 'inherited classes' do
256
-
257
- it 'sees attributes of both classes' do
258
- object = ObjectSpec::InheritingObject.new
259
- object.virtual_string = "string"
260
- object.another_virtual_string = "another string"
261
-
262
- expect(object.virtual_string).to eq("string")
263
- expect(object.another_virtual_string).to eq("another string")
264
- end
265
-
266
- it 'does not define the attribute on the parent class' do
267
- object = ObjectSpec::Object.new
268
- expect(object).not_to respond_to(:another_virtual_string)
269
- end
270
-
271
- end
272
-
273
- describe 'included modules' do
274
- it 'sees attributes of the included module' do
275
- object = ObjectSpec::IncludingObject.new
276
- object.virtual_string = "string"
277
- object.another_virtual_string = "another string"
278
-
279
- expect(object.virtual_string).to eq("string")
280
- expect(object.another_virtual_string).to eq("another string")
281
- end
282
-
283
- it 'does not define the attribute on the parent class' do
284
- object = ObjectSpec::Object.new
285
- expect(object).not_to respond_to(:another_virtual_string)
286
- end
287
- end
288
-
289
- describe 'validations' do
290
- subject { ObjectSpec::ObjectWithValidations.new }
291
-
292
- it 'has 1 error_on' do
293
- expect(subject.error_on(:virtual_string).size).to eq(1)
294
- end
295
-
296
- it 'validates the presence of boolean values' do
297
- subject.virtual_boolean = false
298
- expect(subject.error_on(:virtual_boolean).size).to eq(1)
299
- subject.virtual_boolean = '0'
300
- expect(subject.error_on(:virtual_boolean).size).to eq(1)
301
- subject.virtual_boolean = 0
302
- expect(subject.error_on(:virtual_boolean).size).to eq(1)
303
- subject.virtual_boolean = true
304
- expect(subject.errors_on(:virtual_boolean).size).to eq(0)
305
- end
306
-
307
- it 'has no errors if validations pass' do
308
- subject.virtual_string = "foo"
309
- subject.virtual_boolean = true
310
- expect(subject).to be_valid
311
- expect(subject.errors_on(:virtual_string).size).to eq(0)
312
- end
313
-
314
- it 'causes #save to return false' do
315
- expect(subject.save).to be_falsey
316
- end
317
- end
318
-
319
- describe 'defaults' do
320
- it_should_behave_like "a class accepting attribute defaults", ActiveType::Object
321
- end
322
-
323
- describe 'duping' do
324
- it_should_behave_like "a class supporting dup for attributes", ActiveType::Object
325
-
326
- it 'can dup without attributes' do
327
- expect {
328
- ObjectSpec::PlainObject.new.dup
329
- }.not_to raise_error
330
- end
331
- end
332
-
333
- describe 'dirty tracking' do
334
- it_should_behave_like 'a class supporting dirty tracking for virtual attributes', ActiveType::Object
335
- end
336
-
337
- describe '#belongs_to' do
338
- subject { ObjectSpec::ObjectWithBelongsTo.new }
339
-
340
- it_should_behave_like 'a belongs_to association', :child, ObjectSpec::Child
341
- end
342
-
343
- describe '#save' do
344
- subject { ObjectSpec::ObjectWithCallbacks.new }
345
-
346
- it "returns true" do
347
- subject.save
348
- end
349
-
350
- %w[before_validation before_save after_save after_commit].each do |callback|
351
-
352
- it "calls #{callback}", :rollback => false do
353
- expect(subject).to receive("#{callback}_callback")
354
-
355
- expect(subject.save).to eq(true)
356
- end
357
-
358
- end
359
-
360
- %w[before_validation before_save].each do |callback|
361
-
362
- it "aborts the chain when #{callback} returns false" do
363
- allow(subject).to receive_messages("#{callback}_callback" => false)
364
-
365
- expect(subject.save).to be_falsey
366
- end
367
-
368
- end
369
-
370
- end
371
-
372
- describe '.find' do
373
- it 'raises an error' do
374
- error = if ActiveRecord::VERSION::MAJOR >= 4 && ActiveRecord::VERSION::MINOR >= 1
375
- ActiveRecord::UnknownPrimaryKey
376
- else
377
- ActiveRecord::RecordNotFound
378
- end
379
- expect do
380
- ObjectSpec::Object.find(1)
381
- end.to raise_error(error)
382
- end
383
- end
384
-
385
- describe '.all' do
386
- it 'returns []' do
387
- expect(ObjectSpec::Object.all).to eq([])
388
- end
389
- end
390
-
391
- describe '.create' do
392
- it 'returns an object' do
393
- object = ObjectSpec::Object.create(:virtual_string => "string")
394
-
395
- expect(object).to be_a(ObjectSpec::Object)
396
- expect(object.virtual_string).to eq("string")
397
- end
398
- end
399
-
400
- end
@@ -1,236 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module RecordSpec
4
-
5
- class Record < ActiveType::Record
6
-
7
- attribute :virtual_string, :string
8
- attribute :virtual_integer, :integer
9
- attribute :virtual_time, :datetime
10
- attribute :virtual_date, :date
11
- attribute :virtual_boolean, :boolean
12
- attribute :virtual_attribute
13
-
14
- end
15
-
16
- class RecordWithValidations < Record
17
-
18
- validates :persisted_string, :presence => true
19
- validates :virtual_string, :presence => true
20
-
21
- end
22
-
23
-
24
- class RecordWithOverrides < Record
25
-
26
- attribute :overridable_test, :string
27
-
28
- def overridable_test
29
- super + super
30
- end
31
-
32
- end
33
-
34
- class RecordCopy < ActiveType::Record
35
- self.table_name = 'records'
36
-
37
- attribute :virtual_string, :string
38
-
39
- end
40
-
41
- class OtherRecord < ActiveType::Record
42
- end
43
-
44
- class Child < ActiveRecord::Base
45
- end
46
-
47
- class RecordWithBelongsTo < Record
48
-
49
- attribute :child_id, :integer
50
-
51
- belongs_to :child
52
-
53
- end
54
- end
55
-
56
-
57
- describe ActiveType::Record do
58
-
59
- subject { RecordSpec::Record.new }
60
-
61
- it 'is a ActiveRecord::Base' do
62
- expect(subject).to be_a(ActiveRecord::Base)
63
- end
64
-
65
- it 'is an abstract class' do
66
- expect(ActiveType::Record).to be_abstract_class
67
- end
68
-
69
- describe 'constructors' do
70
- subject { RecordSpec::Record }
71
-
72
- it_should_behave_like 'ActiveRecord-like constructors', { :persisted_string => "string", :persisted_integer => 100, :persisted_time => Time.now, :persisted_date => Date.today, :persisted_boolean => true }
73
-
74
- it_should_behave_like 'ActiveRecord-like constructors', { :virtual_string => "string", :virtual_integer => 100, :virtual_time => Time.now, :virtual_date => Date.today, :virtual_boolean => true }
75
-
76
- end
77
-
78
- describe 'mass assignment' do
79
- it_should_behave_like 'ActiveRecord-like mass assignment', { :persisted_string => "string", :persisted_integer => 100, :persisted_time => Time.now, :persisted_date => Date.today, :persisted_boolean => true }
80
-
81
- it_should_behave_like 'ActiveRecord-like mass assignment', { :virtual_string => "string", :virtual_integer => 100, :virtual_time => Time.now, :virtual_date => Date.today, :virtual_boolean => true }
82
- end
83
-
84
- describe 'accessors' do
85
- it_should_behave_like 'ActiveRecord-like accessors', { :persisted_string => "string", :persisted_integer => 100, :persisted_time => Time.now, :persisted_date => Date.today, :persisted_boolean => true }
86
-
87
- it_should_behave_like 'ActiveRecord-like accessors', { :virtual_string => "string", :virtual_integer => 100, :virtual_time => Time.now, :virtual_date => Date.today, :virtual_boolean => true }
88
- end
89
-
90
- describe 'overridable attributes' do
91
-
92
- subject { RecordSpec::RecordWithOverrides.new }
93
-
94
- it 'is possible to override attributes with super' do
95
- subject.overridable_test = "test"
96
-
97
- expect(subject.overridable_test).to eq("testtest")
98
- end
99
- end
100
-
101
- describe 'attribute name validation' do
102
- it 'crashes when trying to define an invalid attribute name' do
103
- klass = Class.new(ActiveType::Record)
104
- expect {
105
- klass.class_eval do
106
- attribute :"<attr>", :string
107
- end
108
- }.to raise_error(ActiveType::InvalidAttributeNameError)
109
- end
110
- end
111
-
112
- describe '.reset_column_information' do
113
- it 'does not affect virtual attributes' do
114
- RecordSpec::RecordCopy.new.persisted_string = "string"
115
- RecordSpec::RecordCopy.reset_column_information
116
-
117
- expect do
118
- RecordSpec::RecordCopy.new.virtual_string = "string"
119
- end.to_not raise_error
120
- end
121
- end
122
-
123
- context 'coercible' do
124
- describe 'string columns' do
125
- it_should_behave_like 'a coercible string column', :persisted_string
126
- it_should_behave_like 'a coercible string column', :virtual_string
127
- end
128
-
129
- describe 'integer columns' do
130
- it_should_behave_like 'a coercible integer column', :persisted_integer
131
- it_should_behave_like 'a coercible integer column', :virtual_integer
132
- end
133
-
134
- describe 'date columns' do
135
- it_should_behave_like 'a coercible date column', :persisted_date
136
- it_should_behave_like 'a coercible date column', :virtual_date
137
- end
138
-
139
- describe 'time columns' do
140
- it_should_behave_like 'a coercible time column', :persisted_time
141
- it_should_behave_like 'a coercible time column', :virtual_time
142
- end
143
-
144
- describe 'boolean columns' do
145
- it_should_behave_like 'a coercible boolean column', :persisted_boolean
146
- it_should_behave_like 'a coercible boolean column', :virtual_boolean
147
- end
148
-
149
- describe 'untyped columns' do
150
- it_should_behave_like 'an untyped column', :virtual_attribute
151
- end
152
- end
153
-
154
- describe '#attributes' do
155
-
156
- it 'returns a hash of virtual and persisted attributes' do
157
- subject.persisted_string = "string"
158
- subject.virtual_string = "string"
159
- subject.virtual_integer = "17"
160
-
161
- expect(subject.attributes).to eq({
162
- "virtual_string" => "string",
163
- "virtual_integer" => 17,
164
- "virtual_time" => nil,
165
- "virtual_date" => nil,
166
- "virtual_boolean" => nil,
167
- "virtual_attribute" => nil,
168
- "id" => nil,
169
- "persisted_string" => "string",
170
- "persisted_integer" => nil,
171
- "persisted_time" => nil,
172
- "persisted_date" => nil,
173
- "persisted_boolean" => nil
174
- })
175
- end
176
-
177
- end
178
-
179
- describe 'validations' do
180
- subject { RecordSpec::RecordWithValidations.new }
181
-
182
- it 'has 1 error_on' do
183
- expect(subject.error_on(:persisted_string).size).to eq(1)
184
- end
185
- it 'has 1 error_on' do
186
- expect(subject.error_on(:virtual_string).size).to eq(1)
187
- end
188
- end
189
-
190
- describe 'undefined columns' do
191
- it 'raises an error when trying to access an undefined virtual attribute' do
192
- expect do
193
- subject.read_virtual_attribute('foo')
194
- end.to raise_error(ActiveType::MissingAttributeError)
195
- end
196
- end
197
-
198
- describe 'defaults' do
199
- it_should_behave_like "a class accepting attribute defaults", RecordSpec::Record
200
- end
201
-
202
- describe 'duping' do
203
- it_should_behave_like "a class supporting dup for attributes", RecordSpec::Record
204
- end
205
-
206
- describe 'dirty tracking' do
207
- it_should_behave_like 'a class supporting dirty tracking for virtual attributes', RecordSpec::Record
208
- end
209
-
210
- describe 'persistence' do
211
-
212
- it 'persists to the database' do
213
- subject.persisted_string = "persisted string"
214
- expect(subject.save).to eq(true)
215
-
216
- expect(subject.class.find(subject.id).persisted_string).to eq("persisted string")
217
- end
218
- end
219
-
220
- describe 'isolation' do
221
- it 'does not let column information bleed into different models' do
222
- record = RecordSpec::Record.new
223
- other_record = RecordSpec::OtherRecord.new
224
-
225
- expect(record).not_to respond_to(:other_string)
226
- expect(other_record).not_to respond_to(:persisted_string)
227
- end
228
- end
229
-
230
- describe '#belongs_to' do
231
- subject { RecordSpec::RecordWithBelongsTo.new }
232
-
233
- it_should_behave_like 'a belongs_to association', :child, RecordSpec::Child
234
- end
235
-
236
- end