lib/soaspec/shared_examples.rb in soaspec-0.0.8 vs lib/soaspec/shared_examples.rb in soaspec-0.0.9
- old
+ new
@@ -2,15 +2,18 @@
shared_examples_for 'success scenario' do
it 'has status code of 200' do
expect(described_class.status_code).to eq 200
end
- if described_class.mandatory_elements
- context 'has expected mandatory elements' do
- described_class.mandatory_elements.each do |mandatory_element|
- it mandatory_element do
- expect(described_class).to contain_key mandatory_element
- end
+ context 'has expected mandatory elements' do
+ described_class.mandatory_elements.each do |mandatory_element|
+ it mandatory_element do
+ expect(described_class).to contain_key mandatory_element
end
+ end
+ end
+ context 'has expected xpath values' do
+ described_class.mandatory_xpath_values.each do |xpath_pair|
+ it { is_expected.to have_xpath_value xpath_pair }
end
end
end
\ No newline at end of file