Sha256: 60fb143b590a53eda7b7eb34bbf7bb94eb8d572dece098108201f5040445484f

Contents?: true

Size: 765 Bytes

Versions: 4

Compression:

Stored size: 765 Bytes

Contents

module RequestResponseMocks
  def server_response_list
    stub_request(:get, "http://thisisa.test/wd/virus_scans")
      .with(:headers => {'Accept'=>'application/json', 'Authorization'=>'Token abcdefg', 'User-Agent'=>'Ruby'})
      .to_return(:status => 200, :body => yield, :headers => {})
  end

  def server_request_put(options)
    stub_request(:put, "http://thisisa.test/wd/virus_scans/#{options.fetch(:id)}")
      .with(body: %Q{{"virus_scan":{"scan_result":"#{options.fetch(:status)}"}}},
        headers: {
          'Accept'=>'application/json',
          'Authorization'=>'Token abcdefg',
          'Content-Type'=>'application/json',
          'User-Agent'=>'Ruby'
        })
      .to_return(:status => 200, :body => yield, :headers => {})
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
virus_scan_service-0.2.1 spec/support/request_response_mocks.rb
virus_scan_service-0.2.0 spec/support/request_response_mocks.rb
virus_scan_service-0.1.0 spec/support/request_response_mocks.rb
virus_scan_service-0.0.8 spec/support/request_response_mocks.rb