Created
October 20, 2014 18:31
-
-
Save chriscooning/2696e6d8cea751e7b27b to your computer and use it in GitHub Desktop.
static_controller_spec.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "spec_helper" | |
| def check_page_availability(name) | |
| get :show, format: :html, page: name | |
| expect(response.status).to eq 200 | |
| end | |
| describe StaticController do | |
| render_views | |
| context "render pages" do | |
| it 'features' do | |
| check_page_availability('features') | |
| end | |
| it 'privacy' do | |
| check_page_availability('privacy') | |
| end | |
| it 'support' do | |
| check_page_availability('support') | |
| end | |
| it 'team' do | |
| check_page_availability('team') | |
| end | |
| it 'terms' do | |
| check_page_availability('terms') | |
| end | |
| it 'displays correcty 500 message if page not exists' do | |
| expect { | |
| get :show, format: :html, page: :this_page_should_never_exists | |
| expect(response.status).to eq(500) | |
| }.to raise_error(ActionController::RoutingError) | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment