mirror of
https://github.com/jbranchaud/til
synced 2026-01-02 22:58:01 +00:00
Add Capybara Page Status Code as a rails til.
This commit is contained in:
@@ -28,6 +28,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
|
||||
### rails
|
||||
|
||||
- [Attribute Was](rails/attribute-was.md)
|
||||
- [Capybara Page Status Code](rails/capybara-page-status-code.md)
|
||||
- [Creating Records of Has_One Associations](rails/creating-records-of-has-one-associations.md)
|
||||
- [Show Pending Migrations](rails/show-pending-migrations.md)
|
||||
|
||||
|
||||
18
rails/capybara-page-status-code.md
Normal file
18
rails/capybara-page-status-code.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Capybara Page Status Code
|
||||
|
||||
To quickly determine if a page is rendering as expected or not, you can
|
||||
check the status code of the page. If your page is rendering successfully,
|
||||
you'll see something like this:
|
||||
|
||||
```ruby
|
||||
> page.status_code
|
||||
# => 200
|
||||
```
|
||||
|
||||
If some sort of application authorization logic is causing the page to not
|
||||
render as normal, you may see something like this:
|
||||
|
||||
```ruby
|
||||
> page.status_code
|
||||
# => 403
|
||||
```
|
||||
Reference in New Issue
Block a user