Sha256: dd9ec4a54ff79221075f537b3b4200e510ef3ba5552ed45040850558170fce4f

Contents?: true

Size: 706 Bytes

Versions: 1

Compression:

Stored size: 706 Bytes

Contents

require 'spec_helper'
 
describe RailsScopes::ScopesCombiner do
	let(:example) do 
	  class Example
  	  extend RailsScopes::ScopesCombiner

  	  @statuses = { active: 22, inactive: 14, running: 32, stuck: 42, waiting: 465, dunno: 4880 }
      class << self
        attr_reader :statuses
      end
      
  	  combine_scopes_for_attribute :status, statuses
      self
    end
	end

	describe "RailsScopes::ScopesCombiner" do
	
	  it "extends ScopesCombiner" do
      example.should respond_to :combined_scopes_names
    end
 
    it "creates methods for statuses" do
      example.combined_scopes_names(example.statuses).each do |name|
        example.should respond_to name
      end
    end
 
	end
 
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_scopes-0.0.3 spec/rails_scopes/scope_combiner_spec.rb