Sha256: ed9acf754a25762852bf9656bae74b180b208b3f732fa3118e72788c5c2b74dc

Contents?: true

Size: 847 Bytes

Versions: 26

Compression:

Stored size: 847 Bytes

Contents

require 'rspec'

shared_examples_for 'success scenario' do
  it 'has successful status code' do
    expect(200..299).to cover described_class.status_code
  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

26 entries across 26 versions & 1 rubygems

Version Path
soaspec-0.0.72 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.71 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.70 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.69 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.68 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.67 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.66 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.65 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.64 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.63 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.62 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.61 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.60 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.59 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.58 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.57 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.56 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.55 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.54 lib/soaspec/soaspec_shared_examples.rb
soaspec-0.0.53 lib/soaspec/soaspec_shared_examples.rb