Sha256: c3169db6e5e53cdf3d7ccf1dcd4dfa4dc62b8bfe646b714bad605a0e42bc5079

Contents?: true

Size: 716 Bytes

Versions: 4

Compression:

Stored size: 716 Bytes

Contents

shared_examples "a sendgrid response" do |path|
  let(:test_connection) { double(:connection) }

  before do
    test_connection.stub(:post).
      with(path, anything).
      and_return(double(:response, code: 200, body: response))
    subject.stub(:connection).and_return(test_connection)
  end

  it "makes a json request to #{path}" do
    params = double(:parameters)
    subject.stub(:default_params) { params }
    test_connection.should_receive(:post).
      with(path, params)
    action
  end

  it 'returns a Sendgrid::Web::Response' do
    result = action
    result.should be_instance_of(Sendgrid::Web::Response)
    result.status_code.should eql(200)
    result.raw_body.should eql(response)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sendgrid-web-0.1.0 spec/support/shared_sendgrid_response.rb
sendgrid-web-0.0.7 spec/support/shared_sendgrid_response.rb
sendgrid-web-0.0.6 spec/support/shared_sendgrid_response.rb
sendgrid-web-0.0.5 spec/support/shared_sendgrid_response.rb