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.124 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.123 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.122 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.121 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.120 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.119 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.118 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.117 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.116 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.115 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.114 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.113 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.112 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.111 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.110 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.109 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.108 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.107 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.106 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb
ree_lib-1.0.105 lib/ree_lib/packages/ree_swagger/spec/functions/build_parameters_spec.rb