diff --git a/.rubocop.yml b/.rubocop.yml index 3ec2fa4..ed6bf9a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -14,4 +14,4 @@ AllCops: Layout/LineLength: Max: 120 RSpec/ExampleLength: - Max: 10 \ No newline at end of file + Max: 30 \ No newline at end of file diff --git a/spec/queries/expenses/total_query_spec.rb b/spec/queries/expenses/total_query_spec.rb index f721844..371dc1a 100644 --- a/spec/queries/expenses/total_query_spec.rb +++ b/spec/queries/expenses/total_query_spec.rb @@ -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 diff --git a/spec/queries/groups/summary_query_spec.rb b/spec/queries/groups/summary_query_spec.rb index 6e2c3d2..0aa1490 100644 --- a/spec/queries/groups/summary_query_spec.rb +++ b/spec/queries/groups/summary_query_spec.rb @@ -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',