Sha256: 835cc11227393e703359ef79d25d582559ac71780bc18e1ef4659ff71f90f19f

Contents?: true

Size: 1.27 KB

Versions: 22

Compression:

Stored size: 1.27 KB

Contents

require 'dalli'
require 'fake_web'
# Require the spec helper relative to this file
require File.join(File.dirname(__FILE__), %w[spec_helper])
require File.join(File.dirname(__FILE__), %w[custom_matchers_spec])
require File.join(File.dirname(__FILE__), %w[ .. lib services search])
require File.join(File.dirname(__FILE__), %w[ .. lib services activity])
include Active::Services

    
describe Search do
    after(:each) do
      begin
        Active.CACHE.flush() if Active.CACHE
      rescue Exception => e
      end
      Active.memcache_host(nil)
    end
    it "should search by city" do
      Active.memcache_host("localhost:11211")
      s = Search.search({:city=>"Oceanside"})
      s.city.should eql("Oceanside")
      s.results.should_not be_nil
      s.results.should have_at_least(1).items
      Active.CACHE.get('ce16c9ef2b618d0d5a88d46933109e4d').results.length.should eql(10)
      s = Search.search({:city=>"Oceanside"})
      s.city.should eql("Oceanside")
      s.results.should_not be_nil
      s.results.should have_at_least(1).items
    end
    it "should be fail safe" do
      Active.memcache_host("fake:11211")
      s = Search.search({:city=>"Oceanside"})
      s.city.should eql("Oceanside")      
      s.results.should have_at_least(1).items      
    end    
end





Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
Active-0.0.42 spec/search_memcached_spec.rb
Active-0.0.41 spec/search_memcached_spec.rb
Active-0.0.40 spec/search_memcached_spec.rb
Active-0.0.39 spec/search_memcached_spec.rb
Active-0.0.38 spec/search_memcached_spec.rb
Active-0.0.37 spec/search_memcached_spec.rb
Active-0.0.36 spec/search_memcached_spec.rb
Active-0.0.35 spec/search_memcached_spec.rb
Active-0.0.34 spec/search_memcached_spec.rb
Active-0.0.32 spec/search_memcached_spec.rb
Active-0.0.31 spec/search_memcached_spec.rb
Active-0.0.30 spec/search_memcached_spec.rb
Active-0.0.29 spec/search_memcached_spec.rb
Active-0.0.28 spec/search_memcached_spec.rb
Active-0.0.27 spec/search_memcached_spec.rb
Active-0.0.26 spec/search_memcached_spec.rb
Active-0.0.25 spec/search_memcached_spec.rb
Active-0.0.24 spec/search_memcached_spec.rb
Active-0.0.23 spec/search_memcached_spec.rb
Active-0.0.22 spec/search_memcached_spec.rb