Sha256: 556b9118deb95875266577d200336a94bf308048d7ffa05b20dd299ae48872d4

Contents?: true

Size: 660 Bytes

Versions: 3

Compression:

Stored size: 660 Bytes

Contents

require 'spec_helper'

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

    def mock_entry(stubs={})
      @mock_entry ||= FactoryGirl.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

3 entries across 3 versions & 1 rubygems

Version Path
borutus-0.2.1 spec/controllers/reports_controller_spec.rb
borutus-0.2.0 spec/controllers/reports_controller_spec.rb
borutus-0.1.0 spec/controllers/reports_controller_spec.rb