From 85389e8b8699741abc521405058fdbc06feb6cbb Mon Sep 17 00:00:00 2001 From: Sam <sam.saffron@gmail.com> Date: Fri, 26 Jul 2013 14:41:58 +1000 Subject: [PATCH] spec for trashable --- spec/components/trashable_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 spec/components/trashable_spec.rb diff --git a/spec/components/trashable_spec.rb b/spec/components/trashable_spec.rb new file mode 100644 index 00000000000..7a0cca9453c --- /dev/null +++ b/spec/components/trashable_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' +require_dependency 'trashable' + +describe Trashable do + # post is trashable, just use it. + it "works correctly" do + p1 = Fabricate(:post) + p2 = Fabricate(:post) + + Post.count.should == 2 + p1.trash! + + Post.count.should == 1 + + Post.with_deleted.count.should == 2 + end +end +