Welcome to mirror list, hosted at ThFree Co, Russian Federation.

response_status_with_error_shared_examples.rb « requests « shared_examples « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: de012aebaad6947db728ce0472fad72efdce62ad (plain)
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true

RSpec.shared_examples 'returning response status with error' do |status:, error: nil|
  it "returns #{status} and error message" do
    subject

    expect(response).to have_gitlab_http_status(status)
    expect(json_response['error']).to be_present
    expect(json_response['error']).to match(error) if error
  end
end