Permalink
Browse files

Fix books controller specs for exposure

According to the guide, this action purpose is to expose all books
to the view. It now compares exposed books to those persisted in
the setup rather than an empty array.
  • Loading branch information...
Bounga committed Jun 25, 2015
1 parent 53415d8 commit dc5205a4a15d4195713bf73b0dc5d12426bb8fef
Showing with 7 additions and 1 deletion.
  1. +7 −1 source/guides/getting-started.md
@@ -572,14 +572,20 @@ describe Web::Controllers::Books::Index do
let(:action) { Web::Controllers::Books::Index.new }
let(:params) { Hash[] }
before do
BookRepository.clear
@book = BookRepository.create(Book.new(title: 'TDD', author: 'Kent Beck'))
end
it "is successful" do
response = action.call(params)
response[0].must_equal 200
end
it 'exposes all books' do
action.call(params)
action.exposures[:books].must_equal []
action.exposures[:books].must_equal [@book]
end
end
```

0 comments on commit dc5205a

Please sign in to comment.