Sha256: 14cd555411e946c92f806d95af93ff18ab96a7005c0e2aeb95bf916d391662fb

Contents?: true

Size: 1.92 KB

Versions: 6

Compression:

Stored size: 1.92 KB

Contents

Feature: The client can be used for clearing down Mirage.

  As with the restful interface, clearing a template also clears any associated request data

  Background:
    Given the following require statements are needed:
    """
    require 'rubygems'
    require 'mirage/client'
    """

    And a template for 'greeting' has been set with a value of 'Hello'

    And I send GET to '/responses/greeting' with parameters:
      | message | hello there |
    And a template for 'leaving' has been set with a value of 'Goodbye'

    And I send GET to '/responses/greeting' with parameters:
      | message | I'm going |


  Scenario: Clearing a template
    Given I run
    """
    Mirage::Client.new.templates(1).delete
    """
    When GET is sent to '/responses/greeting'
    Then a 404 should be returned
    When GET is sent to '/requests/1'
    Then a 404 should be returned

    When GET is sent to '/responses/leaving'
    Then a 200 should be returned
    When GET is sent to '/requests/2'
    Then a 200 should be returned


  Scenario: Clearning a request
    Given I run
    """
    Mirage::Client.new.requests(1).delete
    """
    When GET is sent to '/requests/1'
    Then a 404 should be returned
    When GET is sent to '/responses/greeting'
    Then a 200 should be returned


  Scenario: Clearing everything
    When I run
    """
    Mirage::Client.new.templates.delete_all
    """
    And GET is sent to '/responses/greeting'
    Then a 404 should be returned

    When GET is sent to '/requests/1'
    Then a 404 should be returned

    And GET is sent to '/responses/leaving'
    Then a 404 should be returned

    When GET is sent to '/requests/2'
    Then a 404 should be returned


  Scenario: Clearing all request data
    When I run
    """
    Mirage::Client.new.requests.delete_all
    """
    When GET is sent to '/requests/1'
    Then a 404 should be returned

    When GET is sent to '/requests/2'
    Then a 404 should be returned

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mirage-3.0.0.alpha.17 features/client/clear.feature
mirage-3.0.0.alpha.16 features/client/clear.feature
mirage-3.0.0.alpha.15 features/client/clear.feature
mirage-3.0.0.alpha.14 features/client/clear.feature
mirage-3.0.0.alpha.13 features/client/clear.feature
mirage-3.0.0.alpha.12 features/client/clear.feature