test/sandbox_test.rb in sandboxy-1.0.0 vs test/sandbox_test.rb in sandboxy-1.1.0

- old
+ new

@@ -1,18 +1,28 @@ require File.dirname(__FILE__) + '/test_helper' class SandboxTest < ActiveSupport::TestCase - context '#sandbox' do + context 'scopes' do + should 'be defined' do + assert Some.respond_to? :live_scoped + assert Some.respond_to? :sandboxed_scoped + assert Some.respond_to? :live + assert Some.respond_to? :sandboxed + assert Some.respond_to? :desandbox + end + end + + context 'sandbox' do setup do @post = FactoryGirl.create :post @purchase = FactoryGirl.create :purchase $sandbox = true @book = FactoryGirl.create :book @receipt = FactoryGirl.create :receipt end - context 'desandbox' do + context '#desandbox' do should 'return all records' do assert_equal Some.unscope(:joins, :where).all, Some.desandbox end end