Last active
September 17, 2015 13:34
-
-
Save dmitryrck/14828a332b6274514bdf to your computer and use it in GitHub Desktop.
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
require 'rails_helper' | |
describe BookCreator do | |
context 'create a book by isbn' do | |
before do | |
VCR.use_cassette('search-isbn') do | |
book | |
end | |
end | |
let :book do | |
BookCreator.create_by_isbn('9781118084786') | |
end | |
it 'should be a book' do | |
expect(book).to be_a Book | |
end | |
it 'should be persisted' do | |
expect(book).to be_persisted | |
end | |
it 'set correct isbn' do | |
expect(book.isbn).to eq '9781118084786' | |
end | |
it 'set correct title' do | |
expect(book.title).to eq 'Ruby on Rails For Dummies' | |
end | |
it 'set correct authors' do | |
expect(book.authors).to eq 'Barry Burd' | |
end | |
it 'set correct year' do | |
expect(book.year_published).to eq 2011 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment