-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
342: Split `spec/support/active_record_classes.rb` r=ellnix a=ellnix A first step toward #332 Co-authored-by: ellnix <103502144+ellnix@users.noreply.github.com>
- Loading branch information
Showing
25 changed files
with
570 additions
and
527 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'support/sequel_models/book' | ||
|
||
describe 'When sequel record is created' do | ||
before do | ||
SequelBook.clear_index!(true) | ||
end | ||
|
||
it 'indexes the book' do | ||
steve_jobs = SequelBook.create name: 'Steve Jobs', author: 'Walter Isaacson', premium: true, released: true | ||
results = SequelBook.search('steve') | ||
|
||
expect(results.size).to eq(1) | ||
expect(results[0].id).to eq(steve_jobs.id) | ||
end | ||
|
||
it 'does not override after hooks' do | ||
allow(SequelBook).to receive(:new).and_call_original | ||
SequelBook.create name: 'Steve Jobs', author: 'Walter Isaacson', premium: true, released: true | ||
expect(SequelBook).to have_received(:new).twice | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.