From 62daed9251863b68ac88f6214de07afa1f393ef9 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Tue, 24 Mar 2015 19:59:48 -0500 Subject: [PATCH] Add Capybara Page Status Code as a rails til. --- README.md | 1 + rails/capybara-page-status-code.md | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 rails/capybara-page-status-code.md diff --git a/README.md b/README.md index 536dd51..f6fe6e4 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/rails/capybara-page-status-code.md b/rails/capybara-page-status-code.md new file mode 100644 index 0000000..248a49c --- /dev/null +++ b/rails/capybara-page-status-code.md @@ -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 +```