Skip to content

Instantly share code, notes, and snippets.

@treble37
Created February 3, 2015 05:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save treble37/13e4c401798788242a13 to your computer and use it in GitHub Desktop.
Save treble37/13e4c401798788242a13 to your computer and use it in GitHub Desktop.
Step 3 - Testing ElasticSearch - posts_spec.rb
require 'spec_helper'
require 'rake'
RSpec.describe Api::V1::PostsController, :vcr, record: :new_episodes, :type => :api do
context "elastic search test", elasticsearch: true, commit: true do
before do
@post = FactoryGirl.create(:post, first_name: "August", last_name: "Rush", email: "August.Rush@augustrush.com", event: "Rock Concert")
end
it "should handle case-insensitive searching for a user" do
sleep 1
get "1/posts", {:search=>"Rush"}
expect(last_response.body).to include("August", "Rush")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment