Skip to content
Browse files
Fix books controller create action
- add missing `action` variable
- cleanup DB before starting tests
- use `BookRepository` to check if a record was created since calling
`` won't work. `book` isn't an instance variable and isn't
exposed by the controller and doesn't have to be.
  • Loading branch information
Bounga committed Jun 25, 2015
1 parent 53415d8 commit 0e7b5f91e4ffc9ee9ad66c3e7195469f58e07d80
Showing with 3 additions and 2 deletions.
  1. +3 −2 source/guides/
@@ -713,15 +713,16 @@ require 'spec_helper'
require_relative '../../../../apps/web/controllers/books/create'
describe Web::Controllers::Books::Create do
let(:action) { }
let(:params) { Hash[book: { title: 'Confident Ruby', author: 'Avdi Grimm' }] }
after do
before do
it 'creates a new book' do
BookRepository.all.count.wont_equal 0
it 'redirects the user to the books listing' do

0 comments on commit 0e7b5f9

Please sign in to comment.