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
エラー:params.require(:book).permit(:title、:abstract、:author、:pages、price:image_file_name、:genre、:published_on)Rspec rails routesエラーパラメータがありません
ActionController::ParameterMissing:
param is missing or the value is empty: book
のリストをテストする必要性を満たすん、それはのための未定義のメソッド '許可証」を示しています"424":文字列 – jerrytom
予約の詳細ページにリダイレクトしています – jerrytom
コントローラを追加できますか –