Sha256: b2cea399ea446168a200a33765b0138de1d0a655df7422452ff04e5bbb05044a

Contents?: true

Size: 1.22 KB

Versions: 84

Compression:

Stored size: 1.22 KB

Contents

require 'spec_helper'
require 'pact_broker/doc/controllers/app'

module PactBroker
  module Doc
    module Controllers
      describe App do

        describe "GET relation" do

          let(:app) { PactBroker::Doc::Controllers::App }

          context "when the resource exists" do
            subject { get "/webhooks" }

            it "returns a 200 status" do
              subject
              expect(last_response.status).to eq 200
            end

            it "returns a html content type" do
              subject
              expect(last_response.headers['Content-Type']).to eq "text/html;charset=utf-8"
            end

            it "returns a html body" do
              subject
              expect(last_response.body).to include "<html>"
            end
          end

          context "when the resource does not exist" do
            subject { get "/blah" }

            it "returns a 404 status" do
              subject
              expect(last_response.status).to eq 404
            end

            it "returns a html content type" do
              subject
              expect(last_response.headers['Content-Type']).to eq "text/html;charset=utf-8"
            end

          end
        end

      end
    end
  end
end

Version data entries

84 entries across 84 versions & 1 rubygems

Version Path
pact_broker-2.12.0 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.11.0 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.10.0 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.9.0 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.9.0.beta.5 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.8.0.beta.5 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.8.0.beta.4 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.7.0.beta.3 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.7.0.beta.2 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.7.0.beta.1 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.6.0 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.5.1 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.5.0 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.4.2 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.4.1 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.4.0 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.3.0 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.2.0 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.1.1 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.1.0 spec/lib/pact_broker/doc/controllers/app_spec.rb