Sha256: 39c5ff5c1a6d023c66454ed915d70af5525cdb675dd8a897fe84d3a2b529a919

Contents?: true

Size: 1.41 KB

Versions: 27

Compression:

Stored size: 1.41 KB

Contents

require 'spec_helper'

RSpec.describe "Test", :type => :request do

  describe "With a defined Pages" do

    describe "GET /" do

      before do
        @root = TypeStation::Page.create!(title: 'Index page', template_name: 'blank_index')
        @page = TypeStation::Page.create!(title: 'About us', template_name: 'blank_index', parent: @root)
        @page2 = TypeStation::Page.create!(title: 'Redirect', template_name: 'blank_index', redirect_to: '/place-to-redirect', parent: @root)
        @page3 = TypeStation::Page.create!(title: 'place to redirect', template_name: 'blank_index', parent: @root)
      end

      it "will return 200 on get /" do
        get "/type_station"
        expect(response).to have_http_status(200)
      end

      it "will return 200 on get /type_station/about-us" do
        get "/type_station/about-us"
        expect(response).to have_http_status(200)
      end

      it "will return 200 on get /type_station/about-us/" do
        get "/type_station/about-us/"
        expect(response).to have_http_status(200)
      end

      it "will return 200 on get /type_station/redirect" do
        get "/type_station/redirect"
        expect(response).to have_http_status(302)
      end

    end

  end

  describe "Without a defined Index Page" do
    describe "GET /" do
      it "will return a 404" do
        get "/type_station"
        expect(response).to have_http_status(404)
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
type_station-0.2.2 spec/integration/pages_index_spec.rb
type_station-0.2.1 spec/integration/pages_index_spec.rb
type_station-0.2.0 spec/integration/pages_index_spec.rb
type_station-0.1.3 spec/integration/pages_index_spec.rb
type_station-0.1.1 spec/integration/pages_index_spec.rb
type_station-0.0.3 spec/integration/pages_index_spec.rb
type_station-0.0.2 spec/integration/pages_index_spec.rb