rspec-rails: add feature tests

This commit is contained in:
Rico Sta. Cruz 2015-11-17 21:25:36 +11:00
parent c1e836c08d
commit d354fd7020
1 changed files with 17 additions and 0 deletions

View File

@ -40,6 +40,9 @@ describe MyController do
expect(response).to be_success
expect(response).to have_http_status(200)
expect(response).to render_template("index")
expect(response).to redirect_to '/..'
expect(assigns :article).to eq article
response.status
end
@ -109,6 +112,20 @@ describe EventsHelper do
end
```
### Features
```rb
# spec/features/*.rb
feature 'Signing in' do
background do
User.make email: 'hi@gmail.com'
end
scenario 'Signing in with credentials' do
end
end
```
### Matchers
```rb