Browse files

Mogli::Model#destroy_and_get_result to uninstall a Tab from FB and ge…

…t the response result
  • Loading branch information...
1 parent a731932 commit f4a6e3b7868b62dcdc1d33380ed5126b4f4843aa @gaizka committed Oct 14, 2011
Showing with 10 additions and 0 deletions.
  1. +5 −0 lib/mogli/model.rb
  2. +5 −0 spec/model_spec.rb
View
5 lib/mogli/model.rb
@@ -50,6 +50,11 @@ def destroy
freeze
end
+ def destroy_and_get_result
+ client.delete(id)
+ end
+
+
def self.included(other)
other.extend(ClassMethods)
end
View
5 spec/model_spec.rb
@@ -100,6 +100,11 @@ class TestModel < Mogli::Model
model.should be_frozen
end
+ it "allows deleting the post, and inspecting the result" do
+ mock_client.should_receive(:delete).with(1)
+ model.destroy_and_get_result
+ end
+
it "emits warnings when properties that don't exist are written to" do
model.should_receive(:warn_about_invalid_property).with("doesnt_exist")
model.doesnt_exist=1

0 comments on commit f4a6e3b

Please sign in to comment.