Sha256: 236002e6e4620d0d0a471b6e67013aaa96ab23ed906333f4afe839bcf5596cb5
Contents?: true
Size: 664 Bytes
Versions: 1
Compression:
Stored size: 664 Bytes
Contents
require "#{File.dirname(__FILE__)}/../spec_helper" describe ScopedSearch::Definition do before(:each) do @klass = mock_activerecord_class @definition = ScopedSearch::Definition.new(@klass) @definition.stub!(:setup_adapter) end describe '#initialize' do it "should create the named scope when" do @klass.should_receive(:named_scope).with(:search_for, instance_of(Proc)) ScopedSearch::Definition.new(@klass) end it "should not create the named scope if it already exists" do @klass.stub!(:search_for) @klass.should_not_receive(:named_scope) ScopedSearch::Definition.new(@klass) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
scoped_search-2.0.1 | spec/unit/definition_spec.rb |