Sha256: 37e4be70103637e5bab51774342c0519652fea04060386fc5b9d5832554f3fc1

Contents?: true

Size: 1.47 KB

Versions: 25

Compression:

Stored size: 1.47 KB

Contents

@ruby_api
Feature: verify requests that happened on double
  In order to check that my app is performing correct requests
  As test developer
  I want to be able to get double 'call history' 

  Scenario: no calls made to double
    Given I created a double:
    """
    @double = RestAssured::Double.create(:fullpath => '/some/api')
    """
    When I request call history for that double:
    """
    @requests = @double.reload.requests
    """
    Then it should be empty:
    """
    @requests.should be_empty
    """

  Scenario: some calls made to double
    Given I created a double:
    """
    @double = RestAssured::Double.create(:fullpath => '/some/path', :content => 'some content', :verb => 'POST')
    """
    When that double gets requested:
    """
    post @double.fullpath, { :foo => 'bar' }.to_json, "CONTENT_TYPE" => "application/json"
    post @double.fullpath, { :fooz => 'baaz'}, 'SOME_HEADER' => 'header_data'
    """
    And I request call history for that double:
    """
    @requests = @double.reload.requests
    """
    Then I should see history records for those requests:
    """
    @requests.first.body.should == { :foo => 'bar' }.to_json
    @requests.first.params.should == '{}'
    JSON.parse( @requests.first.rack_env )["CONTENT_TYPE"].should == 'application/json'

    @requests.last.body.should == 'fooz=baaz'
    JSON.parse( @requests.last.params ).should == { 'fooz' => 'baaz' }
    JSON.parse( @requests.last.rack_env )["SOME_HEADER"].should == 'header_data'
    """

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
rest-assured-4.0.0 features/ruby_api/verify_requests.feature
rest-assured-3.0.1 features/ruby_api/verify_requests.feature
rest-assured-3.0.0 features/ruby_api/verify_requests.feature
rest-assured-2.2.0 features/ruby_api/verify_requests.feature
rest-assured-2.1.0 features/ruby_api/verify_requests.feature
rest-assured-2.0.2 features/ruby_api/verify_requests.feature
rest-assured-2.0.1 features/ruby_api/verify_requests.feature
rest-assured-2.0.0 features/ruby_api/verify_requests.feature
rest-assured-1.2.2 features/ruby_api/verify_requests.feature
rest-assured-1.2.1 features/ruby_api/verify_requests.feature
rest-assured-1.2.0 features/ruby_api/verify_requests.feature
rest-assured-1.1.10 features/ruby_api/verify_requests.feature
rest-assured-1.1.9 features/ruby_api/verify_requests.feature
rest-assured-1.1.8 features/ruby_api/verify_requests.feature
rest-assured-1.1.7 features/ruby_api/verify_requests.feature
rest-assured-1.1.6 features/ruby_api/verify_requests.feature
rest-assured-1.1.5 features/ruby_api/verify_requests.feature
rest-assured-1.1.4 features/ruby_api/verify_requests.feature
rest-assured-1.1.3 features/ruby_api/verify_requests.feature
rest-assured-1.1.2 features/ruby_api/verify_requests.feature