Sha256: cbcedcd4d72640c76754fa01e0b46bd653480c8d6e3582585281fce6d5706502

Contents?: true

Size: 600 Bytes

Versions: 6

Compression:

Stored size: 600 Bytes

Contents

module APIResponseMatchers
  extend RSpec::Matchers::DSL

  matcher :reject_as_unprocessable do
    match_unless_raises ActiveSupport::TestCase::Assertion do |response|
      expect(response.status).to eq(422)
    end

    failure_message do |response|
      "Expected response to be a 422: Unprocessable Entity"
    end

    failure_message_when_negated do |source|
      "Expected response not to be a 422: Unprocessable Entity"
    end

    description do
      "should send a 422: Unprocessable Entity status"
    end
  end
end


class RSpec::Core::ExampleGroup
  include APIResponseMatchers
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
xing-backend-1.0.0.pre.beta lib/xing/spec_helpers/api_response_matchers.rb
xing-backend-0.0.25 lib/xing/spec_helpers/api_response_matchers.rb
xing-backend-0.0.23 lib/xing/spec_helpers/api_response_matchers.rb
xing-backend-0.0.22 lib/xing/spec_helpers/api_response_matchers.rb
xing-backend-0.0.21 lib/xing/spec_helpers/api_response_matchers.rb
xing-backend-0.0.20 lib/xing/spec_helpers/api_response_matchers.rb