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.0.5 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.0.4 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.0.3 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.0.2 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.0.1 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.0.0 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.0.0.beta.8 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.0.0.beta.7 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.0.0.beta.6 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-1.18.0 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.0.0.beta.5 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-1.18.0.beta.1 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-1.17.2 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-1.17.1 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.0.0.beta.4 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.0.0.beta.3 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.0.0.beta.2 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-2.0.0.beta.1 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-1.17.0 spec/lib/pact_broker/doc/controllers/app_spec.rb
pact_broker-1.16.0 spec/lib/pact_broker/doc/controllers/app_spec.rb