Instantly share code, notes, and snippets.

Embed
What would you like to do?
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