Run Rubocop autocorrect on spec/queries

This commit is contained in:
Manuel Bustillo 2024-12-28 17:36:06 +01:00
parent b85e2ef932
commit 27c7feebee
3 changed files with 11 additions and 7 deletions

View File

@ -14,4 +14,4 @@ AllCops:
Layout/LineLength:
Max: 120
RSpec/ExampleLength:
Max: 10
Max: 30

View File

@ -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

View File

@ -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',