Run Rubocop autocorrect on spec/queries
This commit is contained in:
parent
b85e2ef932
commit
27c7feebee
@ -14,4 +14,4 @@ AllCops:
|
||||
Layout/LineLength:
|
||||
Max: 120
|
||||
RSpec/ExampleLength:
|
||||
Max: 10
|
||||
Max: 30
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
require 'rails_helper'
|
||||
@ -61,8 +63,8 @@ module Expenses
|
||||
end
|
||||
|
||||
it 'returns the sum of fixed and variable expenses', :aggregate_failures do
|
||||
expect(response['total_confirmed']).to eq(100 + 200 + 50 * 2)
|
||||
expect(response['total_projected']).to eq(100 + 200 + 11 * 50)
|
||||
expect(response['total_confirmed']).to eq(100 + 200 + (50 * 2))
|
||||
expect(response['total_projected']).to eq(100 + 200 + (11 * 50))
|
||||
expect(response['confirmed_guests']).to eq(2)
|
||||
expect(response['projected_guests']).to eq(2 + 4 + 5)
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
require 'rails_helper'
|
||||
@ -5,7 +7,7 @@ require 'rails_helper'
|
||||
module Groups
|
||||
RSpec.describe SummaryQuery do
|
||||
describe '#call' do
|
||||
subject { described_class.new.call }
|
||||
subject(:result) { described_class.new.call }
|
||||
|
||||
context 'when there are no groups' do
|
||||
it { is_expected.to eq([]) }
|
||||
@ -17,7 +19,7 @@ module Groups
|
||||
|
||||
context 'when there are no guests' do
|
||||
it 'returns the summary of groups' do
|
||||
is_expected.to contain_exactly(
|
||||
expect(result).to contain_exactly(
|
||||
{ 'id' => parent.id,
|
||||
'name' => 'Friends',
|
||||
'icon' => 'icon-1',
|
||||
@ -58,11 +60,11 @@ module Groups
|
||||
create_list(:guest, 8, group: child, status: :invited)
|
||||
create_list(:guest, 9, group: child, status: :confirmed)
|
||||
create_list(:guest, 10, group: child, status: :declined)
|
||||
create_list(:guest, 11, group: child, status: :tentative)
|
||||
create_list(:guest, 11, group: child, status: :tentative) # rubocop:disable FactoryBot/ExcessiveCreateList
|
||||
end
|
||||
|
||||
it 'returns the summary of groups' do
|
||||
is_expected.to contain_exactly(
|
||||
expect(result).to contain_exactly(
|
||||
{
|
||||
'id' => parent.id,
|
||||
'name' => 'Friends',
|
||||
|
Loading…
x
Reference in New Issue
Block a user