Sha256: f03f81ff0991aefe653b5478d6f8edce83bc05ad4deecbf589824bcc060f72eb

Contents?: true

Size: 909 Bytes

Versions: 12

Compression:

Stored size: 909 Bytes

Contents

# frozen_string_literal: true

require 'rspec'

RSpec.shared_examples_for 'success scenario' do
  it 'has successful status code' do
    expect(described_class.successful_status_code?).to be true
  end
  context 'has expected mandatory elements' do
    described_class.exchange_handler.expected_mandatory_elements.each do |mandatory_element|
      it mandatory_element do
        expect(described_class).to contain_key mandatory_element
      end
    end
  end
  described_class.exchange_handler.expected_mandatory_xpath_values.each do |xpath, value|
    it "has xpath '#{xpath}' equal to '#{value}'" do
      expect(described_class).to have_xpath_value(xpath => value)
    end
  end
  described_class.exchange_handler.expected_mandatory_json_values.each do |xpath, value|
    it "has json '#{xpath}' equal to '#{value}'" do
      expect(described_class).to have_xpath_value(xpath => value)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
soaspec-0.3.11 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.3.10 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.3.9 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.3.8 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.3.7 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.3.6 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.3.3 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.3.2 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.3.1 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.2.32 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.2.31 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.2.30 lib/soaspec/soaspec_shared_examples.rb