id 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/id.gemspec +1 -1
- data/lib/id/model.rb +1 -1
- data/spec/lib/id_spec.rb +8 -0
- metadata +1 -1
data/Gemfile.lock
CHANGED
data/id.gemspec
CHANGED
data/lib/id/model.rb
CHANGED
data/spec/lib/id_spec.rb
CHANGED
@@ -32,6 +32,14 @@ describe Id::Model do
|
|
32
32
|
nested_models: [{ 'yak' => 11}, { yak: 14 }],
|
33
33
|
extra_nested_model: { cats!: "MIAOW" }) }
|
34
34
|
|
35
|
+
|
36
|
+
describe ".new" do
|
37
|
+
it 'converts any passed id models to their hash representations' do
|
38
|
+
new_model = TestModel.new(test_model: model)
|
39
|
+
new_model.test_model.data.should eq model.data
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
35
43
|
describe ".field" do
|
36
44
|
it 'defines an accessor on the model' do
|
37
45
|
model.foo.should eq 3
|