Sha256: bd0b3e3e69401413740742543a9f4629c2bb435bf126b44341e5cdbf1cd31198

Contents?: true

Size: 1.99 KB

Versions: 15

Compression:

Stored size: 1.99 KB

Contents

Feature: Clearing Templates

  The client can be used to clear responses and tracked request data from Mirage.

  Like when calling Mirage's own interface directly, 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: Clearing 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

15 entries across 15 versions & 2 rubygems

Version Path
mirage-3.0.13 features/client/clear.feature
mirage-3.0.12 features/client/clear.feature
mirage-3.0.11 features/client/clear.feature
mirage-3.0.10 features/client/clear.feature
mirage-3.0.9 features/client/clear.feature
mirage-on-thin-3.0.8 features/client/clear.feature
mirage-3.0.8 features/client/clear.feature
mirage-3.0.7 features/client/clear.feature
mirage-3.0.6 features/client/clear.feature
mirage-3.0.5 features/client/clear.feature
mirage-3.0.4 features/client/clear.feature
mirage-3.0.3 features/client/clear.feature
mirage-3.0.2 features/client/clear.feature
mirage-3.0.1 features/client/clear.feature
mirage-3.0.0 features/client/clear.feature