Skip to content

Commit

Permalink
Merge branch 'model-parent' of https://github.com/gabrielrios/volt in…
Browse files Browse the repository at this point in the history
…to gabrielrios-model-parent
  • Loading branch information
ryanstout committed Sep 18, 2015
2 parents ab6407f + fed9f34 commit 503a743
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/models/array_model_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,17 @@
end
end
end
context "appending a model" do
it "sets the parent to self" do
item = Volt::Model.new
array = Volt::ArrayModel.new([], { path: [:items], parent: double("StoreRoot") })
array << item
expect(item.parent).to eq(array)

sub = Volt::Model.new
item._sub_items << sub
expect(sub.parent).to eq(item._sub_items)
end
end

end

0 comments on commit 503a743

Please sign in to comment.