Sha256: 630d14b6af227e56275cbf66cfdfe2ed10f9cd90cd313d5770d82d8094ea5ea4

Contents?: true

Size: 836 Bytes

Versions: 11

Compression:

Stored size: 836 Bytes

Contents

require 'rspec'

shared_examples_for 'success scenario' do
  it 'has status code of 200' do
    expect(described_class.status_code).to eq 200
  end
  context 'has expected mandatory elements' do
    described_class.api_class.expected_mandatory_elements.each do |mandatory_element|
      it mandatory_element do
        expect(described_class).to contain_key mandatory_element
      end
    end
  end
  described_class.api_class.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.api_class.expected_mandatory_json_values.each do |xpath, value|
    it "has xpath '#{xpath}' equal to '#{value}'" do
      expect(described_class).to have_xpath_value(xpath => value)
    end
  end


end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
soaspec-0.0.46 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.45 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.44 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.43 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.42 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.41 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.40 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.39 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.38 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.37 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.36 lib/soaspec/soaspec_shared_examples.rb