Browse files

extend! test

  • Loading branch information...
1 parent 80b9cac commit 715f19bc56cdcb75c45c380f03635ebb62ccd0c2 @Femaref committed Mar 23, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 spec/base_spec.rb
View
12 spec/base_spec.rb
@@ -28,4 +28,16 @@
lambda { real.extend }.should_not raise_error
end
end
+
+ describe "extend!" do
+ it "should copy additional fields to the current object" do
+ HTTParty.stub(:get) { double(:body => %q({ "id" : "1", "name": "test" })) }
+
+ real = AutoGenerateTestClass.new({:id => 1})
+
+ real.extend!
+
+ real.name.should == "test"
+ end
+ end
end

0 comments on commit 715f19b

Please sign in to comment.