Sha256: 7db9b67717e4a47c4255f86308173695f37f2b21759a2b543415734090f3b15e

Contents?: true

Size: 1.6 KB

Versions: 13

Compression:

Stored size: 1.6 KB

Contents

# frozen_string_literal: true

shared_examples 'empty response' do
  it 'should match JSON empty' do
    message
    expect(@response.to_json).to eq('{}')
  end
end

shared_examples 'schema response' do
  it do
    message
    expect(@response.to_json).to match_json_schema(@type)
  end
end

shared_examples 'transaction should match json empty' do
  let(:message) do
    @gateway.start_transaction(false, @session_instance) do |transaction|
      @response = transaction.publish_message(@type)
    end
  end

  include_examples 'empty response'
end

shared_examples 'transaction should match json schema' do
  let(:message) do
    @gateway.start_transaction(true, @session_instance) do |transaction|
      @response = transaction.publish_message(@type)
    end
  end

  include_examples 'schema response'
end

shared_examples 'transaction handle should match json schema' do
  let(:message) do
    @gateway.start_transaction_handle(true, @session_instance) do |transaction|
      @response = transaction.publish_message(@type, @options)
    end
  end

  include_examples 'schema response'
end

shared_examples 'transaction handle should match json empty' do
  let(:message) do
    @gateway.start_transaction_handle(false, @session_instance) do |transaction|
      @response = transaction.publish_message(@type, @options)
    end
  end

  include_examples 'empty response'
end

shared_examples 'transaction admin should match json schema' do
  let(:message) do
    @gateway.start_transaction_admin do |transaction|
      @response = transaction.publish_message(@type, @options)
    end
  end

  include_examples 'schema response'
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ruby_rabbitmq_janus-2.2.0.pre.159 spec/support/examples_request.rb
ruby_rabbitmq_janus-2.2.0.pre.42 spec/support/examples_request.rb
ruby_rabbitmq_janus-2.1.1 spec/support/examples_request.rb
ruby_rabbitmq_janus-2.1.1.pre.139 spec/support/examples_request.rb
ruby_rabbitmq_janus-2.1.0 spec/support/examples_request.rb
ruby_rabbitmq_janus-2.1.0.pre.137 spec/support/examples_request.rb
ruby_rabbitmq_janus-2.1.0.pre.136 spec/support/examples_request.rb
ruby_rabbitmq_janus-2.1.0.pre.135 spec/support/examples_request.rb
ruby_rabbitmq_janus-2.1.0.pre.132 spec/support/examples_request.rb
ruby_rabbitmq_janus-2.1.0.pre.131 spec/support/examples_request.rb
ruby_rabbitmq_janus-2.1.0.pre.130 spec/support/examples_request.rb
ruby_rabbitmq_janus-2.1.0.pre.129 spec/support/examples_request.rb
ruby_rabbitmq_janus-2.1.0.pre.128 spec/support/examples_request.rb