Sha256: 9bf31bc1fcc24c5d0c532c60a153dfceca4bbd9cf02b637ecb4b02e3af85410d

Contents?: true

Size: 598 Bytes

Versions: 1

Compression:

Stored size: 598 Bytes

Contents

require 'spec_helper'

describe 'Error pages' do
  shared_examples_for 'error page' do |path, code, content|
    it "should return #{code}" do
      visit path

      expect(page.status_code).to eq code
      expect(page).to have_content content
    end
  end

  context 'access to 403 page' do
    it_behaves_like 'error page', '/forbidden', 403, 'Forbidden'
  end

  context 'access to 404 page' do
    it_behaves_like 'error page', '/not_found', 404, 'Not Found'
  end

  context 'access to 500 page' do
    it_behaves_like 'error page', '/application_error', 500, 'Application Error'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rexception-0.1.0 spec/requests/error_pages_spec.rb