Sha256: 9e4f499e4060b174cda13504abf6dd1e38329e5baf46b99371d3fb7177e98d49

Contents?: true

Size: 1.91 KB

Versions: 2

Compression:

Stored size: 1.91 KB

Contents

Feature: html generation

  Lurker generates pretty info pages based on schema information
  and form which allow you to test live api.
  When testing your api ensure that CSRF protection is handled properlya
  with `protect_from_forgery :null_session`

  @javascript
  Scenario: json schema gets generated into html preview using "users/create"
    Given an empty directory named "public/lurker"
    And a file named "lurker/api/v1/users-POST.json.yml" with:
      """yml
      ---
      prefix: users management
      description: user creation
      requestParameters:
        properties:
          user:
            type: object
            properties:
              name:
                type: string
                example: Bob
      responseCodes:
      - status: 200
        successful: true
        description: ''
      responseParameters:
        properties:
          id:
            type: integer
            example: 1
          name:
            type: string
            example: Bob
        required: []
      extensions:
        method: POST
        path_info: "/api/v1/users.json"
        path_params:
          controller: api/v1/users
          action: create
      """

  When I successfully run `bin/lurker convert`
  Then the output should contain these lines:
    """
            Converting lurker to html
     using  lurker

    create  public/lurker/index.html
    create  public/lurker/api/v1/users-POST.html
    """

  When I go to "/lurker"
  Then I should see "users management"

  When I click on "users management"
  Then I should see "user creation"

  When I click on "user creation"
  And I fill in the submit form field "name" with "Jim"
  Then I should see:
    """
    curl -X POST -d "user%5Bname%5D=Jim"
    """

   And I submit lurk form

  Then I should see JSON response with "Jim"

  When I fill in the submit form field "name" with ""
   And I submit it

  Then I should see JSON response with "can't be blank"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lurker-0.6.8 features/html_generation.feature
lurker-0.6.7 features/html_generation.feature