Sha256: 12b2cca0227cb2f01f3bd5e473ea21ab5163522938386692d9c14d75db0cfa7e

Contents?: true

Size: 1.55 KB

Versions: 15

Compression:

Stored size: 1.55 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

describe SwaggerDocsGenerator::Actions::Path, type: :parser,
                                              name: :params_path do
  let(:param_name) { nil }
  let(:param_description) { nil }
  let(:param_required) { nil }
  let(:param_type) { nil }
  let(:param) do
    pname = param_name
    pdescription = param_description
    prequired = param_required
    ptype = param_type
    SwaggerDocsGenerator::Actions::Parameter.new do
      path do
        name pname
        description pdescription
        required prequired
        type ptype
      end
    end
  end

  context 'when attribute complete' do
    let(:param_name) { Faker::Color.color_name }
    let(:param_description) { Faker::Beer.name }
    let(:param_required) { Faker::Boolean.boolean }
    let(:param_type) { Faker::Name.first_name }

    it_behaves_like 'parameters path haves'
  end

  context 'when attribute is incomplete' do
    it_behaves_like 'parameters path haves'
  end

  context 'when name attribute alone' do
    let(:param_name) { Faker::Color.color_name }

    it_behaves_like 'parameters path haves'
  end

  context 'when description attribute alone' do
    let(:param_description) { Faker::Beer.name }

    it_behaves_like 'parameters path haves'
  end

  context 'when required attribute alone' do
    let(:param_required) { Faker::Boolean.boolean }

    it_behaves_like 'parameters path haves'
  end

  context 'when type attribute alone' do
    let(:param_type) { Faker::Name.first_name }

    it_behaves_like 'parameters path haves'
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
swagger_docs_generator-0.5.1 spec/swagger_docs_generator/parser/parameters/param_path_spec.rb
swagger_docs_generator-0.5.0.pre.42 spec/swagger_docs_generator/parser/parameters/param_path_spec.rb
swagger_docs_generator-0.4.0 spec/swagger_docs_generator/parser/parameters/param_path_spec.rb
swagger_docs_generator-0.3.6 spec/swagger_docs_generator/parser/parameters/param_path_spec.rb
swagger_docs_generator-0.3.6.pre.34 spec/swagger_docs_generator/parser/parameters/param_path_spec.rb
swagger_docs_generator-0.3.5 spec/swagger_docs_generator/parser/parameters/param_path_spec.rb
swagger_docs_generator-0.3.5.pre.31 spec/swagger_docs_generator/parser/parameters/param_path_spec.rb
swagger_docs_generator-0.3.4.pre.26 spec/swagger_docs_generator/parser/parameters/param_path_spec.rb
swagger_docs_generator-0.3.4 spec/swagger_docs_generator/parser/parameters/param_path_spec.rb
swagger_docs_generator-0.3.4.pre.23 spec/swagger_docs_generator/parser/parameters/param_path_spec.rb
swagger_docs_generator-0.3.3 spec/swagger_docs_generator/parser/parameters/param_path_spec.rb
swagger_docs_generator-0.3.2 spec/swagger_docs_generator/parser/parameters/param_path_spec.rb
swagger_docs_generator-0.3.1 spec/swagger_docs_generator/parser/parameters/param_path_spec.rb
swagger_docs_generator-0.3.0.pre.19 spec/swagger_docs_generator/parser/parameters/param_path_spec.rb
swagger_docs_generator-0.3.0.pre.18 spec/swagger_docs_generator/parser/parameters/param_path_spec.rb