Sha256: c819081086b42ba1b5f5e4c1549cc609190acef3efee162126d9f925d6987baa

Contents?: true

Size: 553 Bytes

Versions: 7

Compression:

Stored size: 553 Bytes

Contents

require 'spec_helper'
require 'webmock/rspec'

describe 'post' do
  it 'should allow testing on post requests' do
    mock_post('simple_post')
    post '/simple_post', {}
    expect_json_types({status: :string, someNumber: :int})
  end

  it 'should allow testing on post requests' do
    url = 'http://www.example.com/simple_post'
    stub_request(:post, url)
    post '/simple_post', 'hello', {content_type: "text/plain"}
    expect(WebMock).to have_requested(:post, url).with(:body => "hello", :headers => {'Content-Type' => 'text/plain'})
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
airborne-0.1.15 spec/airborne/post_spec.rb
airborne-0.1.14 spec/airborne/post_spec.rb
airborne-0.1.13 spec/airborne/post_spec.rb
airborne-0.1.12 spec/airborne/post_spec.rb
airborne-0.1.11 spec/airborne/post_spec.rb
airborne-0.1.10 spec/airborne/post_spec.rb
airborne-0.1.9 spec/airborne/post_spec.rb