spec/unit/definition_spec.rb in scoped_search-3.0.1 vs spec/unit/definition_spec.rb in scoped_search-3.1.0

- old
+ new

@@ -23,35 +23,17 @@ end end end describe '#initialize' do + it "should create the named scope when" do + @klass.should_receive(:scope).with(:search_for, instance_of(Proc)) + ScopedSearch::Definition.new(@klass) + end - if ActiveRecord::VERSION::MAJOR == 2 - - 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 - - elsif ActiveRecord::VERSION::MAJOR == 3 - - it "should create the named scope when" do - @klass.should_receive(: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(:scope) - 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(:scope) + ScopedSearch::Definition.new(@klass) end end end