Sha256: 987e89b6585ac8ae63e39c92ceae9bbfdffaafd5c7db13868feafcb93c8e1eff
Contents?: true
Size: 703 Bytes
Versions: 14
Compression:
Stored size: 703 Bytes
Contents
require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper')) require 'algolia/webmock' WebMock.disable! describe 'With a mocked client' do before(:each) do WebMock.enable! Thread.current[:algolia_hosts] = Thread.current[:algolia_search_hosts] = nil # reset session objects end it "should add a simple object" do index = Algolia::Index.new("friends") index.add_object!({ :name => "John Doe", :email => "john@doe.org" }) index.search('').should == { "hits" => [ { "objectID" => 42 } ], "page" => 1, "hitsPerPage" => 1 } # mocked index.list_user_keys index.browse index.clear index.delete end after(:each) do WebMock.disable! end end
Version data entries
14 entries across 14 versions & 1 rubygems