Sha256: 4b677fd9a97aec1466e75888f9ee6031be08876b2e46d965c725d1c3abc759b0
Contents?: true
Size: 1.05 KB
Versions: 1
Compression:
Stored size: 1.05 KB
Contents
# encoding: utf-8 require 'spec_helper' describe ScopeComposer::Model do subject do class TestClass include ScopeComposer::Model has_scope_composer scope :say_hi, ->(t){ 'hi' } scope_helper :helper_method, ->(t){ 'hi' } scope_composer_for :search search_scope :limit search_scope :offset, prefix: true search_helper :tester, ->(t){ t.to_i } end TestClass end it { should respond_to :scope_composer_for } it { should respond_to :scope_scope } it { should respond_to :scope } it { should respond_to :say_hi } it { should respond_to :search_scope } it { should respond_to :search_helper } it { should respond_to :limit } it { should respond_to :offset_search } it { should_not respond_to :tester } it "should define a scope helper" do TestClass.say_hi('hi').should respond_to :helper_method end describe "#where" do it "should return self" do subject.limit(1).where( id: 1 ).class.should eq TestClass::SearchScope end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
scope_composer-0.2.0 | spec/scope_composer/model_spec.rb |