Sha256: b05e61d3707358f055c31daf56c43a0fb7c79880107a6de32bcfab92bf74cbc2

Contents?: true

Size: 881 Bytes

Versions: 2

Compression:

Stored size: 881 Bytes

Contents

require 'spec_helper'

describe APIMatchers::HTTPStatusCode::BeUnprocessableEntity do
  describe "should be_unprocessable_entity" do
    it "should passes if the actual is equal to 422" do
      expect(422).to be_unprocessable_entity
    end

    it "should fails if the actual is not equal to 422" do
      expect {
        expect(500).to be_unprocessable_entity
      }.to fail_with(%Q{expected that '500' to be Unprocessable entity with the status '422'.})
    end
  end

  describe "should_not be_unprocessable_entity" do
    it "should passes if the actual is not equal to 200" do
      expect(400).not_to be_unprocessable_entity
    end

    it "should fail if the actual is equal to 200" do
      expect {
        expect(422).not_to be_unprocessable_entity
      }.to fail_with(%Q{expected that '422' to NOT be Unprocessable entity with the status '422'.})
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
api_matchers-0.5.1 spec/api_matchers/http_status_code/be_unprocessable_entity_spec.rb
api_matchers-0.5.0 spec/api_matchers/http_status_code/be_unprocessable_entity_spec.rb