rspec-rails: add feature tests
This commit is contained in:
parent
c1e836c08d
commit
d354fd7020
|
@ -40,6 +40,9 @@ describe MyController do
|
||||||
expect(response).to be_success
|
expect(response).to be_success
|
||||||
expect(response).to have_http_status(200)
|
expect(response).to have_http_status(200)
|
||||||
expect(response).to render_template("index")
|
expect(response).to render_template("index")
|
||||||
|
expect(response).to redirect_to '/..'
|
||||||
|
|
||||||
|
expect(assigns :article).to eq article
|
||||||
|
|
||||||
response.status
|
response.status
|
||||||
end
|
end
|
||||||
|
@ -109,6 +112,20 @@ describe EventsHelper do
|
||||||
end
|
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
|
### Matchers
|
||||||
|
|
||||||
```rb
|
```rb
|
||||||
|
|
Loading…
Reference in New Issue