Sha256: f048e928e90b81c70aabe081d3c6d863208d13537c484c39fc054e5f699fd2fb

Contents?: true

Size: 798 Bytes

Versions: 22

Compression:

Stored size: 798 Bytes

Contents

RSpec.describe :build_request_body_schema_spec do
  link :build_request_body_schema, from: :ree_swagger
  link :build_mapper_factory, from: :ree_mapper
  link :build_mapper_strategy, from: :ree_mapper

  let(:mapper_factory) {
    strategies = [
      build_mapper_strategy(method: :cast, output: :symbol_key_hash),
    ]

    build_mapper_factory(
      strategies: strategies
    )
  }

  it {
    caster = mapper_factory.call.use(:cast) do
      string :name
      string :email
      string? :last_name
    end

    schema = {
      type: "object",
      properties: {
        name: { type: "string" },
        email: { type: "string" },
        last_name: { type: "string" }
      },
      required: ["name", "email"]
    }

    expect(build_request_body_schema(caster)).to eq(schema)
  }
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ree_lib-1.0.30 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.29 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.28 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.27 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.26 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.24 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.23 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.22 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.21 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.20 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.19 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.18 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.17 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.16 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.15 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.14 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.13 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.12 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.11 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb
ree_lib-1.0.10 lib/ree_lib/packages/ree_swagger/spec/functions/build_request_body_spec.rb