Sha256: c12ae8fb307adc36072933eceaf6650eccfbd13afc2f204058b094ac29b0389a

Contents?: true

Size: 659 Bytes

Versions: 4

Compression:

Stored size: 659 Bytes

Contents

require 'spec_helper'

module Borutus
  describe ReportsController do
    routes { Borutus::Engine.routes }

    def mock_entry(stubs={})
      @mock_entry ||= FactoryBot.create(:entry_with_credit_and_debit)
    end

    describe "GET balance_sheet" do
      it "renders when one entry exists" do
        allow(Entry).to receive_message_chain(:order).and_return([mock_entry])
        get :balance_sheet
        expect(response).to be_success
      end
      it "renders when no entries exist" do
        allow(Entry).to receive_message_chain(:order).and_return([])
        get :balance_sheet
        expect(response).to be_success
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
borutus-1.0.0 spec/controllers/reports_controller_spec.rb
borutus-0.2.4 spec/controllers/reports_controller_spec.rb
borutus-0.2.3 spec/controllers/reports_controller_spec.rb
borutus-0.2.2 spec/controllers/reports_controller_spec.rb