Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
require "spec_helper"
RSpec.describe SchoolsIndex, chewy: true do
describe 'school model obersavation' do
it 'updates the index when a school is saved' do
school = FactoryGirl.build(:school)
expect { school.save! }.to update_index('schools')
end
require 'chewy/rspec'
# Configure rspec to work with chewy
#
# By default, all chewy requests are ignored. This is important in case
# models (or factories by extension) contain after_commit hooks
#
# If a test or example group has chewy: true set on its metadata, then
# the example is run within the update strategy which immediately
# updates the index. Also, the index is purged before every test
if Rails.env.test?
# Setup test indexes with 'test' prefix and run synchronously by waiting for index updates
Chewy.settings = Chewy.settings.reverse_merge(
prefix: 'test',
wait_for_status: 'yellow'
)
end
(describe-variable 'evil-emacs-state-map)
#("evil-emacs-state-map is a variable defined in `evil-states.el'.
Its value is shown below.
This variable may be risky if used as a file-local variable.
Documentation:
Keymap for Emacs state.
Value: (keymap