Sha256: 972a395552d4192b47b0be6b816db4241cea55b3b521f84b821ad89982fcb59e

Contents?: true

Size: 703 Bytes

Versions: 9

Compression:

Stored size: 703 Bytes

Contents

require 'rails_helper'

module Logistics
  module Core
    RSpec.describe DocumentTypeOriginsController, 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_origins as @document_type_origins' do
          document_type_origin = DocumentTypeOrigin.create! valid_attributes
          get :index, format: :json
          expect(JSON(response.body)['data'].to_json).to eq([document_type_origin].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_origins_controller_spec.rb
logistics_core-21.11.1 spec/controllers/logistics/core/document_type_origins_controller_spec.rb
logistics_core-21.08.1 spec/controllers/logistics/core/document_type_origins_controller_spec.rb
logistics_core-21.03.1 spec/controllers/logistics/core/document_type_origins_controller_spec.rb
logistics_core-20.10.3 spec/controllers/logistics/core/document_type_origins_controller_spec.rb
logistics_core-20.10.2 spec/controllers/logistics/core/document_type_origins_controller_spec.rb
logistics_core-20.10.1 spec/controllers/logistics/core/document_type_origins_controller_spec.rb
logistics_core-20.9.1 spec/controllers/logistics/core/document_type_origins_controller_spec.rb
logistics_core-20.8.1 spec/controllers/logistics/core/document_type_origins_controller_spec.rb