|
9 | 9 | submitted_by: user, |
10 | 10 | task: task) |
11 | 11 | end |
| 12 | + let!(:submission_invoice) { FactoryBot.create(:submission_invoice, submission: submission) } |
12 | 13 | let(:framework) { submission.framework } |
13 | 14 | let(:task) { FactoryBot.create(:task, period_month: 12, period_year: 2018, status: :in_progress) } |
14 | 15 | let(:supplier) { submission.supplier } |
|
19 | 20 | revenue_category_ids: { framework.short_name => 'Revenue_Category_WID' } |
20 | 21 | ) |
21 | 22 | allow(Workday::CommercialAgreements).to receive(:new).and_return(commercial_agreements) |
| 23 | + |
| 24 | + customer_invoice = instance_double( |
| 25 | + Workday::CustomerInvoice, |
| 26 | + invoice_details: { |
| 27 | + invoice_amount: '0.20', |
| 28 | + invoice_date: '2018-12-31-00:00', |
| 29 | + invoice_number: 'CINV-00000001', |
| 30 | + payment_status: 'Paid' |
| 31 | + } |
| 32 | + ) |
| 33 | + |
| 34 | + # rubocop:disable Layout/LineLength |
| 35 | + allow(Workday::CustomerInvoice).to receive(:new).with(submission_invoice.workday_reference).and_return(customer_invoice) |
| 36 | + # rubocop:enable Layout/LineLength |
22 | 37 | end |
23 | 38 |
|
24 | 39 | it_behaves_like 'a workday request' |
|
51 | 66 | end |
52 | 67 |
|
53 | 68 | it 'sets Note_Data with the name of the user who submitted the correction submission' do |
54 | | - expect(text_at_xpath('//ns0:Note_Data//ns0:Note_Content')).to eq 'ForenameR SurnameR' |
| 69 | + expect(text_at_xpath('//ns0:Note_Data//ns0:Note_Content')).to eq "ForenameR SurnameR : #{correcting_user.email}" |
55 | 70 | end |
56 | 71 |
|
57 | 72 | it 'sets the invoice adjustment as submitted' do |
|
63 | 78 | it 'sets Line_Item_Description with a description of the charge' do |
64 | 79 | expect( |
65 | 80 | text_at_xpath('//ns0:Customer_Invoice_Line_Replacement_Data//ns0:Line_Item_Description') |
66 | | - ).to eq 'Reversal of invoice for December 2018 management charge' |
| 81 | + ).to eq 'Reversal of invoice CINV-00000001 for December 2018 management charge' |
67 | 82 | end |
68 | 83 |
|
69 | 84 | it 'sets Analytical_Amount as the negative value of the total spend for the submission' do |
|
0 commit comments