Sha256: 57851ffd9e7bd168ba72b31a69e485893c3343381d0a48bd961a5b4b26bf7016

Contents?: true

Size: 719 Bytes

Versions: 9

Compression:

Stored size: 719 Bytes

Contents

require 'rails_helper'

module Logistics
  module Core
    RSpec.describe DocumentTypeCategoriesController, type: :controller do
      routes { Logistics::Core::Engine.routes }

      let(:valid_attributes) {
        {
          code: FFaker::Name.name ,
          name: FFaker::Name.name,
          description: FFaker::Lorem.paragraph
        }
      }

      describe 'GET #index' do
        it 'assigns all document_type_categories as @document_type_categories' do
          document_type_category = DocumentTypeCategory.create! valid_attributes
          get :index, format: :json
          expect(JSON(response.body)['data'].to_json).to eq([document_type_category].to_json)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
logistics_core-21.11.2 spec/controllers/logistics/core/document_type_categories_controller_spec.rb
logistics_core-21.11.1 spec/controllers/logistics/core/document_type_categories_controller_spec.rb
logistics_core-21.08.1 spec/controllers/logistics/core/document_type_categories_controller_spec.rb
logistics_core-21.03.1 spec/controllers/logistics/core/document_type_categories_controller_spec.rb
logistics_core-20.10.3 spec/controllers/logistics/core/document_type_categories_controller_spec.rb
logistics_core-20.10.2 spec/controllers/logistics/core/document_type_categories_controller_spec.rb
logistics_core-20.10.1 spec/controllers/logistics/core/document_type_categories_controller_spec.rb
logistics_core-20.9.1 spec/controllers/logistics/core/document_type_categories_controller_spec.rb
logistics_core-20.8.1 spec/controllers/logistics/core/document_type_categories_controller_spec.rb