You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
644 B
25 lines
644 B
# frozen_string_literal: true |
|
|
|
require 'rails_helper' |
|
|
|
RSpec.describe AnnualReport do |
|
describe '#generate' do |
|
subject { described_class.new(account, Time.zone.now.year) } |
|
|
|
let(:account) { Fabricate :account } |
|
|
|
it 'builds a report for an account' do |
|
expect { subject.generate } |
|
.to change(GeneratedAnnualReport, :count).by(1) |
|
end |
|
end |
|
|
|
describe '.prepare' do |
|
before { Fabricate :status } |
|
|
|
it 'generates records from source class which prepare data' do |
|
expect { described_class.prepare(Time.current.year) } |
|
.to change(AnnualReport::StatusesPerAccountCount, :count).by(1) |
|
end |
|
end |
|
end
|
|
|