Sha256: 01b49131f7c5690d6e92052c2e5f7d013f0a7500c2b211ac44f9d9e0a02a09de

Contents?: true

Size: 969 Bytes

Versions: 30

Compression:

Stored size: 969 Bytes

Contents

RSpec.describe :build_parameters_spec do
  link :build_parameters, 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
      hash :id do
        string :name
      end
    end

    expect {
      build_parameters(caster, [:id], false)
    }.to raise_error(
      ReeSwagger::BuildParameters::ObjectPathParamError,
      "path parameter(id) can not be an object"
    )
  }

  it {
    caster = mapper_factory.call.use(:cast) do
      array :id, each: string
    end

    expect {
      build_parameters(caster, [:id], false)
    }.to raise_error(
      ReeSwagger::BuildParameters::ArrayPathParamError,
      "path parameter(id) can not be an array"
    )
  }
end

Version data entries

30 entries across 30 versions & 1 rubygems

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