Sha256: 77ff49f6dadefe8b7ef7cda8185d829fb2ac135ce055732615e4e9f6203d6ef6

Contents?: true

Size: 891 Bytes

Versions: 21

Compression:

Stored size: 891 Bytes

Contents

require 'spec_helper'

describe Request do
  let(:request_url) { "url" }
  let(:trigger_url) { "trigger url" }

  let(:body) { "body" }
  let(:parameters) { {"name" => "joe"} }
  let(:headers) { {"header" => "value"} }

  let(:request_json) do
    {body: body,
     headers: headers,
     parameters: parameters,
     request_url: trigger_url}
  end

  it 'delete a request' do
    request_url = "url"
    Request.should_receive(:delete).with(request_url)
    request = Request.new
    request.request_url = request_url
    request.delete
  end

  it 'should load request data' do
    Request.should_receive(:backedup_get).with(request_url, format: :json).and_return(request_json)

    request = Request.get(request_url)
    request.headers.should == headers
    request.body.should == body
    request.request_url.should == trigger_url
    request.parameters.should == parameters
  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
mirage-3.0.5 spec/client/request_spec.rb
mirage-3.0.4 spec/client/request_spec.rb
mirage-3.0.3 spec/client/request_spec.rb
mirage-3.0.2 spec/client/request_spec.rb
mirage-3.0.1 spec/client/request_spec.rb
mirage-3.0.0 spec/client/request_spec.rb
mirage-3.0.0.alpha.17 spec/client/request_spec.rb
mirage-3.0.0.alpha.16 spec/client/request_spec.rb
mirage-3.0.0.alpha.15 spec/client/request_spec.rb
mirage-3.0.0.alpha.14 spec/client/request_spec.rb
mirage-3.0.0.alpha.13 spec/client/request_spec.rb
mirage-3.0.0.alpha.12 spec/client/request_spec.rb
mirage-3.0.0.alpha.11 spec/client/request_spec.rb
mirage-3.0.0.alpha.10 spec/client/request_spec.rb
mirage-3.0.0.alpha.9 spec/client/request_spec.rb
mirage-3.0.0.alpha.8 spec/client/request_spec.rb
mirage-3.0.0.alpha.7 spec/client/request_spec.rb
mirage-3.0.0.alpha.6 spec/client/request_spec.rb
mirage-3.0.0.alpha.5 spec/client/request_spec.rb
mirage-3.0.0.alpha.4 spec/client/request_spec.rb