Skip to content

Commit

Permalink
Pull request comments: moves new classes into their own files, style …
Browse files Browse the repository at this point in the history
…updates.
  • Loading branch information
jonhyman committed Mar 24, 2015
1 parent 6484d6d commit 955aca0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
5 changes: 5 additions & 0 deletions spec/app/models/store_as_dup_test1.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class StoreAsDupTest1
include Mongoid::Document
embeds_one :store_as_dup_test2, :store_as => :t
field :name
end
5 changes: 5 additions & 0 deletions spec/app/models/store_as_dup_test2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class StoreAsDupTest2
include Mongoid::Document
embedded_in :store_as_dup_test1
field :name
end
16 changes: 3 additions & 13 deletions spec/mongoid/copyable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,14 @@
end

context "when using store_as" do
context "and dynamic attributes are not set" do
it "clones" do
class StoreAsDupTest1
include Mongoid::Document
embeds_one :store_as_dup_test2, :store_as => :t
field :name
end

class StoreAsDupTest2
include Mongoid::Document
embedded_in :store_as_dup_test1
field :name
end
context "and dynamic attributes are not set" do

it "clones" do
t = StoreAsDupTest1.new(:name => "hi")
t.build_store_as_dup_test2(:name => "there")
t.save
copy = t.__send__(method)
copy = t.send(method)
expect(copy.store_as_dup_test2.name).to eq(t.store_as_dup_test2.name)
end
end
Expand Down

0 comments on commit 955aca0

Please sign in to comment.