Sha256: 9a77a21bad156db4375dc53d0451d046a599ad01eb5ab06e689cd54e5e8afb99

Contents?: true

Size: 1.95 KB

Versions: 15

Compression:

Stored size: 1.95 KB

Contents

@ruby_api
Feature: create double
  As ruby developer
  I want to be able to create doubles via client api
  So that interactions with rest-assured server are completely hidden from me

  Scenario: default options
    When I create a double:
    """
    @double = RestAssured::Double.create(:fullpath => '/some/api')
    """
    Then the following should be true:
    """
    @double.verb.should             == 'GET'
    @double.response_headers.should == {}
    @double.status.should           == 200
    @double.content.should          == nil

    get @double.fullpath
    last_response.should be_ok
    """

  Scenario: specify response headers
    When I create a double:
    """
    @double = RestAssured::Double.create(:fullpath => '/some/api', :response_headers => { 'Content-Type2' => 'text/html' })
    """
    Then the following should be true:
    """
    @double.response_headers.should == { 'Content-Type2' => 'text/html' }

    get @double.fullpath
    last_response.headers['Content-Type2'].should == 'text/html'
    """

  Scenario: specify content
    When I create a double:
    """
    @double = RestAssured::Double.create(:fullpath => '/some/api', :content => 'awesome')
    """
    Then the following should be true:
    """
    @double.content = 'awesome'

    get @double.fullpath
    last_response.body == 'awesome'
    """

  Scenario: specify verb
    When I create a double:
    """
    @double = RestAssured::Double.create(:fullpath => '/some/api', :verb => 'POST')
    """
    Then the following should be true:
    """
    @double.verb = 'POST'

    get @double.fullpath
    last_response.should_not be_ok

    post @double.fullpath
    last_response.should be_ok
    """

  Scenario: specify status
    When I create a double:
    """
    @double = RestAssured::Double.create(:fullpath => '/some/api', :status => 302)
    """
    Then the following should be true:
    """
    @double.status = 302

    get @double.fullpath
    last_response.status == 302
    """

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rest-assured-2.0.2 features/ruby_api/create_double.feature
rest-assured-2.0.1 features/ruby_api/create_double.feature
rest-assured-2.0.0 features/ruby_api/create_double.feature
rest-assured-1.2.2 features/ruby_api/create_double.feature
rest-assured-1.2.1 features/ruby_api/create_double.feature
rest-assured-1.2.0 features/ruby_api/create_double.feature
rest-assured-1.1.10 features/ruby_api/create_double.feature
rest-assured-1.1.9 features/ruby_api/create_double.feature
rest-assured-1.1.8 features/ruby_api/create_double.feature
rest-assured-1.1.7 features/ruby_api/create_double.feature
rest-assured-1.1.6 features/ruby_api/create_double.feature
rest-assured-1.1.5 features/ruby_api/create_double.feature
rest-assured-1.1.4 features/ruby_api/create_double.feature
rest-assured-1.1.3 features/ruby_api/create_double.feature
rest-assured-1.1.2 features/ruby_api/create_double.feature