RSpec.describe 'Book', :type => :request do describe 'List Books' do let(:book) { FactoryGirl.create :book } before(:each) do visit root_path end context 'when book is created' do let(:book) { FactoryGirl.create :book, title: 'My Book Title' } it 'should list books' do post books_path({book: book}) expect(page).to have_content 'My Book Title' end end context 'when no book is created' do it 'should not list books' do expect(page).to have_content 'No books found' end end end end
Failure/Error: params.require(:book).permit(:title, :abstract, :author, :pages, :price, :image_file_name, :genre, :published_on)
ActionController::ParameterMissing:
param is missing or the value is empty: book