Sha256: 25a10a57dacfd50df725da2764afdb6d0bc3f6b7d91ac790892edd49893a3614

Contents?: true

Size: 948 Bytes

Versions: 87

Compression:

Stored size: 948 Bytes

Contents

RSpec.describe :build_parameters_spec do
  link :build_mapper_factory, from: :ree_mapper
  link :build_mapper_strategy, from: :ree_mapper
  link :build_parameters, from: :ree_swagger

  let(:mapper_factory) {
    strategies = [
      build_mapper_strategy(method: :cast, dto: 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, 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

87 entries across 87 versions & 1 rubygems

Version Path
ree_lib-1.0.104 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.103 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.102 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.101 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.100 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.99 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.98 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.97 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.96 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.95 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.94 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.93 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.92 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.91 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.90 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.89 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.88 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.87 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.86 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.85 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb