Sha256: f78bbe49c337b03d13214e8db579e5b8882712efa933f526ab3bcfd163656740

Contents?: true

Size: 1.38 KB

Versions: 1

Compression:

Stored size: 1.38 KB

Contents

require 'json'

module Spinach
  module Fixtures
    def root_response
      '{
          "_links": {
              "self": { "href": "/" },
              "posts": { "href": "/posts" },
              "search": { "href": "/search{?q}", "templated": true },
              "api:authors": { "href": "/authors" },
              "next": { "href": "/page2" }
          }
      }'
    end

    def posts_response
      '{
          "_links": {
            "self": { "href": "/posts" },
            "last_post": {"href": "/posts/1"}
          },
          "total_posts": "9"
      }'
    end

    def post_response
      '{
          "_links": {
            "self": { "href": "/posts/1" }
          },
          "title": "My first blog post",
          "body":  "Lorem ipsum dolor sit amet",
          "_embedded": {
            "comments": [
              {
                "title": "Some comment"
              }
            ]
          }
      }'
    end

    def page2_response
      '{
          "_links": {
              "self": { "href": "/page2" },
              "posts": { "href": "/posts_of_page2" },
              "next": { "href": "/page3" }
          }
      }'
    end

    def page3_response
      '{
          "_links": {
              "self": { "href": "/page3" },
              "posts": { "href": "/posts_of_page3" },
              "api:authors": { "href": "/authors" }
          }
      }'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hyperclient-0.7.1 features/support/fixtures.rb