Sha256: 6b753f143b5cd45974a0c94f3243dfad2f9ae43154c8eea31b0fde1298a01fb7

Contents?: true

Size: 765 Bytes

Versions: 22

Compression:

Stored size: 765 Bytes

Contents

require 'spec_helper'

describe 'assertions' do
  describe 'json assertion' do
    let(:doc) do
      test do
        visit '/' do
          assert json: '.key', value: 'value'
        end
      end.to_doc
    end

    let(:fragment) { doc.search('//com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion').first }

    it 'should match on expected value' do
      expect(fragment.search(".//stringProp[@name='EXPECTED_VALUE']").text).to eq "value"
    end

    it 'should match on json path' do
      expect(fragment.search(".//stringProp[@name='JSON_PATH']").text).to eq ".key"
    end

    it 'should have json validation by default' do
      expect(fragment.search(".//boolProp[@name='JSONVALIDATION']").text).to eq "true"
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ruby-jmeter-3.1.08 spec/json_path_assertion_spec.rb
ruby-jmeter-3.1.07 spec/json_path_assertion_spec.rb
ruby-jmeter-3.1.06 spec/json_path_assertion_spec.rb
ruby-jmeter-3.1.05 spec/json_path_assertion_spec.rb
ruby-jmeter-3.1.04 spec/json_path_assertion_spec.rb
ruby-jmeter-3.1.03 spec/json_path_assertion_spec.rb
ruby-jmeter-3.1.02 spec/json_path_assertion_spec.rb
ruby-jmeter-3.1.01 spec/json_path_assertion_spec.rb
ruby-jmeter-3.0.13 spec/json_path_assertion_spec.rb
ruby-jmeter-3.0.12 spec/json_path_assertion_spec.rb
ruby-jmeter-3.0.11 spec/json_path_assertion_spec.rb
ruby-jmeter-3.0.10 spec/json_path_assertion_spec.rb
ruby-jmeter-3.0.9 spec/json_path_assertion_spec.rb
ruby-jmeter-3.0.8 spec/json_path_assertion_spec.rb
ruby-jmeter-3.0.7 spec/json_path_assertion_spec.rb
ruby-jmeter-3.0.6 spec/json_path_assertion_spec.rb
ruby-jmeter-3.0.5 spec/json_path_assertion_spec.rb
ruby-jmeter-3.0.4 spec/json_path_assertion_spec.rb
ruby-jmeter-3.0.3 spec/json_path_assertion_spec.rb
ruby-jmeter-3.0.2 spec/json_path_assertion_spec.rb