Permalink
Browse files

Bring back new_spec.rb explanations

  • Loading branch information...
Bounga committed Jan 17, 2016
1 parent 5ad2e64 commit c8f1d2cf7fec4eeb46607a98df7a044df7634fd8
Showing with 26 additions and 0 deletions.
  1. +26 −0 source/guides/getting-started.md
@@ -932,6 +932,32 @@ describe Web::Views::Books::New do
rendered.must_include('There was a problem with your submission')
rendered.must_include('title is required')
rendered.must_include('author is required')
end
end
```
We should also update our feature spec to reflect this new behavior:
```ruby
# spec/web/features/add_book_spec.rb
require 'features_helper'
describe 'Books' do
# Spec written sooner removed from brevity
it 'displays list of errors when params contains errors' do
visit '/books/new'
within 'form#book-form' do
click_button 'Create'
end
current_path.must_equal('/books')
assert page.has_content?('There was a problem with your submission')
assert page.has_content?('title is required')
assert page.has_content?('author is required')
end
end
```

0 comments on commit c8f1d2c

Please sign in to comment.