diff --git a/.pryrc b/.pryrc index 9ad73bfd7..5e0e1c2bc 100644 --- a/.pryrc +++ b/.pryrc @@ -36,6 +36,6 @@ if defined?(Rails) " ", ANSI_RESET, sandbox_status, - " ", + " " ].join end diff --git a/Gemfile b/Gemfile index d98c57a22..2fbb40646 100644 --- a/Gemfile +++ b/Gemfile @@ -17,7 +17,7 @@ gem "mail-notify" gem "monetize" gem "mini_racer" gem "nanoid" -gem "parser", "~> 2.6.3.0" +gem "parser", "~> 3.0.1.0" gem "pry-rails" gem "puma", "~> 5.5" gem "pundit" diff --git a/Gemfile.lock b/Gemfile.lock index bef514b5b..d3944f3e5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -197,7 +197,6 @@ GEM rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) ipaddr (1.2.3) - jaro_winkler (1.5.4) jbuilder (2.11.3) activesupport (>= 5.0.0) json (2.5.1) @@ -272,8 +271,8 @@ GEM actionpack (>= 4.2) omniauth (~> 2.0) parallel (1.21.0) - parser (2.6.3.0) - ast (~> 2.4.0) + parser (3.0.1.1) + ast (~> 2.4.1) pg (1.2.3) pry (0.13.1) coderay (~> 1.1) @@ -349,7 +348,7 @@ GEM redis-store (>= 1.2, < 2) redis-store (1.9.0) redis (>= 4, < 5) - regexp_parser (2.1.1) + regexp_parser (2.2.0) request_store (1.5.0) rack (>= 1.4) rest-client (2.1.0) @@ -377,15 +376,20 @@ GEM rspec-mocks (~> 3.10) rspec-support (~> 3.10) rspec-support (3.10.2) - rubocop (0.77.0) - jaro_winkler (~> 1.5.1) + rubocop (1.23.0) parallel (~> 1.10) - parser (>= 2.6) + parser (>= 3.0.0.0) rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml + rubocop-ast (>= 1.12.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 1.7) - rubocop-performance (1.5.2) - rubocop (>= 0.71.0) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.15.1) + parser (>= 3.0.1.1) + rubocop-performance (1.12.0) + rubocop (>= 1.7.0, < 2.0) + rubocop-ast (>= 0.4.0) ruby-progressbar (1.11.0) ruby2_keywords (0.0.5) ruby_parser (3.17.0) @@ -432,9 +436,9 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - standard (0.1.8) - rubocop (~> 0.77.0) - rubocop-performance (~> 1.5.1) + standard (1.5.0) + rubocop (= 1.23.0) + rubocop-performance (= 1.12.0) strip_attributes (1.11.0) activemodel (>= 3.0, < 7.0) sync (0.5.0) @@ -452,7 +456,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.8) - unicode-display_width (1.6.1) + unicode-display_width (2.1.0) uniform_notifier (1.14.2) web-console (4.2.0) actionview (>= 6.0.0) @@ -515,7 +519,7 @@ DEPENDENCIES nanoid omniauth-auth0 (~> 3.0) omniauth-rails_csrf_protection (~> 1.0.0) - parser (~> 2.6.3.0) + parser (~> 3.0.1.0) pg pry-byebug pry-rails diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index da49d96bf..aa2f0157c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -14,7 +14,7 @@ def logout_url client_id = ENV["AUTH0_CLIENT_ID"] request_params = { returnTo: root_url, - client_id: client_id, + client_id: client_id } URI::HTTPS.build(host: domain, path: "/v2/logout", query: to_query(request_params)) diff --git a/app/controllers/concerns/auth.rb b/app/controllers/concerns/auth.rb index 85463c85a..4c0ed7669 100644 --- a/app/controllers/concerns/auth.rb +++ b/app/controllers/concerns/auth.rb @@ -1,4 +1,5 @@ class UserNotAuthorised < StandardError; end + module Auth extend ActiveSupport::Concern diff --git a/app/controllers/public/base_controller.rb b/app/controllers/public/base_controller.rb index ffa1c40af..ec88a4424 100644 --- a/app/controllers/public/base_controller.rb +++ b/app/controllers/public/base_controller.rb @@ -8,8 +8,8 @@ def health_check built_at: ENV.fetch("TIME_OF_BUILD", nil), sidekiq: { enqueued: sidekiq_enqueued_size, - retry_size: sidekiq_retry_size, - }, + retry_size: sidekiq_retry_size + } }, status: :ok end diff --git a/app/controllers/staff/actual_uploads_controller.rb b/app/controllers/staff/actual_uploads_controller.rb index d94e3e84f..93dff52a4 100644 --- a/app/controllers/staff/actual_uploads_controller.rb +++ b/app/controllers/staff/actual_uploads_controller.rb @@ -76,7 +76,7 @@ def update activity.roda_identifier, report.financial_quarter.to_s, report.financial_year.to_s, - "%.2f" % 0, + "%.2f" % 0 ] end diff --git a/app/controllers/staff/external_incomes_controller.rb b/app/controllers/staff/external_incomes_controller.rb index 583461765..6cca33195 100644 --- a/app/controllers/staff/external_incomes_controller.rb +++ b/app/controllers/staff/external_incomes_controller.rb @@ -76,7 +76,7 @@ def external_income_params :amount, :financial_quarter, :financial_year, - :oda_funding, + :oda_funding ) end end diff --git a/app/controllers/staff/forecasts_controller.rb b/app/controllers/staff/forecasts_controller.rb index 81c50669f..778845663 100644 --- a/app/controllers/staff/forecasts_controller.rb +++ b/app/controllers/staff/forecasts_controller.rb @@ -105,7 +105,7 @@ def destroy :currency, :value, :financial_quarter, - :financial_year, + :financial_year ) end diff --git a/app/controllers/staff/incoming_transfers_controller.rb b/app/controllers/staff/incoming_transfers_controller.rb index 5fb5da4fd..aab2fc8bb 100644 --- a/app/controllers/staff/incoming_transfers_controller.rb +++ b/app/controllers/staff/incoming_transfers_controller.rb @@ -33,7 +33,7 @@ def transfer_params :value, :destination_id, :source_roda_identifier, - :beis_identifier, + :beis_identifier ) end diff --git a/app/controllers/staff/outgoing_transfers_controller.rb b/app/controllers/staff/outgoing_transfers_controller.rb index 97bb34e10..b49739fba 100644 --- a/app/controllers/staff/outgoing_transfers_controller.rb +++ b/app/controllers/staff/outgoing_transfers_controller.rb @@ -33,7 +33,7 @@ def transfer_params :value, :source_id, :destination_roda_identifier, - :beis_identifier, + :beis_identifier ) end diff --git a/app/controllers/staff/refunds_controller.rb b/app/controllers/staff/refunds_controller.rb index 78e758552..631692395 100644 --- a/app/controllers/staff/refunds_controller.rb +++ b/app/controllers/staff/refunds_controller.rb @@ -94,8 +94,8 @@ def attributes_for_editing "financial_quarter" )) .merge(report: refund.report, - parent_activity: refund.parent_activity, - comment: refund.comment.body) + parent_activity: refund.parent_activity, + comment: refund.comment.body) .merge(persisted: true) end diff --git a/app/controllers/staff/reports_state_controller.rb b/app/controllers/staff/reports_state_controller.rb index c9c7bd271..a42263daf 100644 --- a/app/controllers/staff/reports_state_controller.rb +++ b/app/controllers/staff/reports_state_controller.rb @@ -8,7 +8,7 @@ class Staff::ReportsStateController < Staff::BaseController "submitted" => "submit", "in_review" => "review", "awaiting_changes" => "request_changes", - "approved" => "approve", + "approved" => "approve" } def edit diff --git a/app/helpers/activity_helper.rb b/app/helpers/activity_helper.rb index 0b0e984c1..2b8379ae2 100644 --- a/app/helpers/activity_helper.rb +++ b/app/helpers/activity_helper.rb @@ -21,7 +21,7 @@ def link_to_activity_parent(parent:, user:) end def custom_capitalisation(level) - "#{level.chars.first.upcase}#{level[1..-1]}" + "#{level[0].upcase}#{level[1..]}" end def sdg_options diff --git a/app/helpers/codelist_helper.rb b/app/helpers/codelist_helper.rb index 3bc43d98b..f312a4c47 100644 --- a/app/helpers/codelist_helper.rb +++ b/app/helpers/codelist_helper.rb @@ -74,14 +74,14 @@ def aid_types def aid_type_radio_options aid_types.to_objects_with_description( - code_displayed_in_name: true, + code_displayed_in_name: true ) end def fstc_applies_radio_options [ OpenStruct.new(value: 0, label: I18n.t("form.label.activity.fstc_applies.false")), - OpenStruct.new(value: 1, label: I18n.t("form.label.activity.fstc_applies.true")), + OpenStruct.new(value: 1, label: I18n.t("form.label.activity.fstc_applies.true")) ] end diff --git a/app/helpers/form_helper.rb b/app/helpers/form_helper.rb index 1957c293a..6e35b027a 100644 --- a/app/helpers/form_helper.rb +++ b/app/helpers/form_helper.rb @@ -9,14 +9,14 @@ def list_of_organisations def list_of_matched_effort_providers @list_of_matched_effort_providers ||= [ OpenStruct.new(name: "", id: ""), - Organisation.matched_effort_providers.active, + Organisation.matched_effort_providers.active ].flatten end def list_of_external_income_providers @list_of_external_income_providers ||= [ OpenStruct.new(name: "", id: ""), - Organisation.external_income_providers.active, + Organisation.external_income_providers.active ].flatten end @@ -46,14 +46,14 @@ def list_of_budget_financial_years def user_active_options [ OpenStruct.new(id: "true", name: t("form.user.active.active")), - OpenStruct.new(id: "false", name: t("form.user.active.inactive")), + OpenStruct.new(id: "false", name: t("form.user.active.inactive")) ] end def organisation_active_options [ OpenStruct.new(id: "true", name: t("form.label.organisation.active.true")), - OpenStruct.new(id: "false", name: t("form.label.organisation.active.false")), + OpenStruct.new(id: "false", name: t("form.label.organisation.active.false")) ] end diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index e87ac8426..aef3769ea 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -8,7 +8,7 @@ def welcome(user) personalisation: { name: user.name, link: password_change_link(user: user), - service_url: ENV["DOMAIN"], + service_url: ENV["DOMAIN"] } ) end @@ -16,7 +16,7 @@ def welcome(user) def password_change_link(user:) Auth0Api.new.client.post_password_change( user_id: user.identifier, - result_url: organisation_url(user.organisation), + result_url: organisation_url(user.organisation) )["ticket"] end end diff --git a/app/models/activity.rb b/app/models/activity.rb index 675549b92..f3b9ff761 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -35,7 +35,7 @@ class Activity < ApplicationRecord :channel_of_delivery_code, :oda_eligibility, :oda_eligibility_lead, - :uk_dp_named_contact, + :uk_dp_named_contact ] VALIDATION_STEPS = [ @@ -62,7 +62,7 @@ class Activity < ApplicationRecord :channel_of_delivery_code_step, :oda_eligibility_step, :oda_eligibility_lead_step, - :uk_dp_named_contact_step, + :uk_dp_named_contact_step ] FORM_STATE_VALIDATION_LIST = FORM_STEPS.map(&:to_s).push("complete") @@ -156,12 +156,12 @@ class Activity < ApplicationRecord fund: "fund", programme: "programme", project: "project", - third_party_project: "third_party_project", + third_party_project: "third_party_project" } enum geography: { recipient_region: "Recipient region", - recipient_country: "Recipient country", + recipient_country: "Recipient country" } enum programme_status: { @@ -176,7 +176,7 @@ class Activity < ApplicationRecord completed: 9, stopped: 10, cancelled: 11, - paused: 12, + paused: 12 } NON_CURRENT_PROGRAMME_STATUSES = ["completed", "stopped", "cancelled"] @@ -201,7 +201,7 @@ class Activity < ApplicationRecord enum oda_eligibility: { never_eligible: 0, eligible: 1, - no_longer_eligible: 2, + no_longer_eligible: 2 } scope :programmes, -> { where(level: :programme) } diff --git a/app/models/benefitting_region.rb b/app/models/benefitting_region.rb index 9f19fe1d3..6f96f45a7 100644 --- a/app/models/benefitting_region.rb +++ b/app/models/benefitting_region.rb @@ -24,7 +24,7 @@ def new_from_hash(region) new( name: region["name"], code: region["code"], - level: Level.find_by_code(region["level"]), + level: Level.find_by_code(region["level"]) ) end end diff --git a/app/models/budget.rb b/app/models/budget.rb index e85754d39..cc80d2fc1 100644 --- a/app/models/budget.rb +++ b/app/models/budget.rb @@ -4,7 +4,7 @@ class Budget < ApplicationRecord enum budget_type: { direct: 0, - other_official: 1, + other_official: 1 } belongs_to :parent_activity, class_name: "Activity" diff --git a/app/models/codelist.rb b/app/models/codelist.rb index bad41a473..b824997d4 100644 --- a/app/models/codelist.rb +++ b/app/models/codelist.rb @@ -1,6 +1,8 @@ class Codelist class UnreadableCodelist < StandardError; end + class UnrecognisedSource < StandardError; end + class KeyNotFound < StandardError; end include Enumerable @@ -33,7 +35,7 @@ def codelist_to_hash(path) def initialize_codelists { "iati" => codelist_to_hash("IATI/#{IATI_VERSION}"), - "beis" => codelist_to_hash("BEIS"), + "beis" => codelist_to_hash("BEIS") } end end diff --git a/app/models/commitment.rb b/app/models/commitment.rb index 1688410ba..dc9f7a08e 100644 --- a/app/models/commitment.rb +++ b/app/models/commitment.rb @@ -6,12 +6,12 @@ class Commitment < ApplicationRecord validates :value, :financial_quarter, :financial_year, presence: true validates :value, numericality: { greater_than: 0, - less_than_or_equal_to: 99_999_999_999.00, + less_than_or_equal_to: 99_999_999_999.00 } validates :financial_quarter, inclusion: {in: 1..4} validates :financial_year, numericality: { greater_than_or_equal_to: 2000, less_than_or_equal_to: 3000, - only_integer: true, + only_integer: true } end diff --git a/app/models/export/activity_actuals_columns.rb b/app/models/export/activity_actuals_columns.rb index 876517533..f1f71a544 100644 --- a/app/models/export/activity_actuals_columns.rb +++ b/app/models/export/activity_actuals_columns.rb @@ -14,7 +14,7 @@ def headers [ "Actual spend #{financial_quarter}", "Refund #{financial_quarter}", - "Actual net #{financial_quarter}", + "Actual net #{financial_quarter}" ] else ["Actual net #{financial_quarter}"] diff --git a/app/models/export/activity_attributes_columns.rb b/app/models/export/activity_attributes_columns.rb index fae9d12e7..e5de2bc8f 100644 --- a/app/models/export/activity_attributes_columns.rb +++ b/app/models/export/activity_attributes_columns.rb @@ -7,14 +7,14 @@ class Export::ActivityAttributesColumns :form_state, :extending_organisation_id, :geography, - :parent_id, + :parent_id ] DYNAMIC_ATTRIBUTES = [ :benefitting_region, :flow, :finance, - :tied_status, + :tied_status ] def initialize(activities:, attributes:) diff --git a/app/models/export/activity_attributes_order.rb b/app/models/export/activity_attributes_order.rb index b5f35d76e..1497f6cb6 100644 --- a/app/models/export/activity_attributes_order.rb +++ b/app/models/export/activity_attributes_order.rb @@ -50,7 +50,7 @@ def self.attributes_in_order :gcrf_challenge_area, :fund_pillar, :country_delivery_partners, - :uk_dp_named_contact, + :uk_dp_named_contact ] end end diff --git a/app/models/export/activity_forecast_columns.rb b/app/models/export/activity_forecast_columns.rb index d63d1544c..06cd20e14 100644 --- a/app/models/export/activity_forecast_columns.rb +++ b/app/models/export/activity_forecast_columns.rb @@ -42,12 +42,10 @@ def activity_ids end def forecasts - @_forecasts ||= begin - if @report.nil? - ForecastOverview.new(activity_ids).latest_values - else - ForecastOverview.new(activity_ids).snapshot(@report).all_quarters.as_records - end + @_forecasts ||= if @report.nil? + ForecastOverview.new(activity_ids).latest_values + else + ForecastOverview.new(activity_ids).snapshot(@report).all_quarters.as_records end end @@ -58,7 +56,7 @@ def forecasts_to_hash [ forecast.parent_activity_id, forecast.financial_quarter, - forecast.financial_year, + forecast.financial_year ] ] = forecast.value } diff --git a/app/models/export/financial_quarter_activity_totals.rb b/app/models/export/financial_quarter_activity_totals.rb index eb0400ba2..f08539fc1 100644 --- a/app/models/export/financial_quarter_activity_totals.rb +++ b/app/models/export/financial_quarter_activity_totals.rb @@ -1,7 +1,7 @@ class Export::FinancialQuarterActivityTotals TYPES = { actual: "Actual", - refund: "Refund", + refund: "Refund" } def initialize(type:, activity:, totals:, financial_quarter:) @@ -21,7 +21,7 @@ def total @financial_quarter.quarter, @financial_quarter.financial_year.start_year, @transaction_type, - nil, + nil ], 0) end @@ -31,7 +31,7 @@ def adjustments_total @financial_quarter.quarter, @financial_quarter.financial_year.start_year, "Adjustment", - @transaction_type, + @transaction_type ], 0) end end diff --git a/app/models/fund.rb b/app/models/fund.rb index 13c0b4b4b..8d45cc320 100644 --- a/app/models/fund.rb +++ b/app/models/fund.rb @@ -1,5 +1,6 @@ class Fund class InvalidActivity < StandardError; end + class InvalidFund < StandardError; end attr_reader :id, :name, :short_name diff --git a/app/models/guidance_url.rb b/app/models/guidance_url.rb index 4d78afca8..c4fcbd7a7 100644 --- a/app/models/guidance_url.rb +++ b/app/models/guidance_url.rb @@ -15,9 +15,7 @@ def to_s class << self def yaml - @yaml ||= begin - YAML.safe_load(File.read(Rails.root.join("vendor", "data", "guidance.yml"))).with_indifferent_access - end + @yaml ||= YAML.safe_load(File.read(Rails.root.join("vendor", "data", "guidance.yml"))).with_indifferent_access end end end diff --git a/app/models/import/actual_history.rb b/app/models/import/actual_history.rb index 5a804b027..777b0d934 100644 --- a/app/models/import/actual_history.rb +++ b/app/models/import/actual_history.rb @@ -3,7 +3,7 @@ class Import::ActualHistory roda_identifier: I18n.t("activerecord.attributes.activity.roda_identifier"), financial_quarter: I18n.t("activerecord.attributes.default.financial_quarter"), financial_year: I18n.t("activerecord.attributes.default.financial_year"), - value: I18n.t("activerecord.attributes.default.value"), + value: I18n.t("activerecord.attributes.default.value") } attr_reader :errors, :imported @@ -21,7 +21,7 @@ def call import_actual_history(@csv) end - alias imported? call + alias_method :imported?, :call private @@ -68,7 +68,7 @@ def headers_error def record_import_history imported.each do |actual| changes = { - value: [nil, actual.value], + value: [nil, actual.value] } HistoryRecorder.new(user: @user).call( changes: changes, @@ -166,7 +166,7 @@ def roda_identifier end def roda_identifier_valid? - activity.present? ? true : false + !!activity.present? end def roda_identifier_error diff --git a/app/models/org_participation.rb b/app/models/org_participation.rb index 2f277a965..78f6a3889 100644 --- a/app/models/org_participation.rb +++ b/app/models/org_participation.rb @@ -9,7 +9,7 @@ class OrgParticipation < ApplicationRecord matched_effort_provider: 1, external_income_provider: 2, implementing: 3, - service_owner: 99, + service_owner: 99 } scope :implementing, -> { where(role: :implementing) } diff --git a/app/models/organisation.rb b/app/models/organisation.rb index 4c0df04f6..462a3421b 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -20,7 +20,7 @@ class Organisation < ApplicationRecord matched_effort_provider: 1, external_income_provider: 2, implementing_organisation: 3, - service_owner: 99, + service_owner: 99 } validates_presence_of :organisation_type, :language_code, :default_currency diff --git a/app/models/refund.rb b/app/models/refund.rb index 02aaa1064..b36764456 100644 --- a/app/models/refund.rb +++ b/app/models/refund.rb @@ -12,10 +12,10 @@ class Refund < Transaction def value=(amount) big_decimal = begin - BigDecimal(amount) - rescue ArgumentError, TypeError - return - end + BigDecimal(amount) + rescue ArgumentError, TypeError + return + end write_attribute(:value, -big_decimal.abs) end end diff --git a/app/models/refund_form.rb b/app/models/refund_form.rb index 7a7b6b679..5f8546a5e 100644 --- a/app/models/refund_form.rb +++ b/app/models/refund_form.rb @@ -25,7 +25,7 @@ def attributes financial_quarter: financial_quarter, financial_year: financial_year, value: value, - comment: comment, + comment: comment } end diff --git a/app/models/report.rb b/app/models/report.rb index 09d391f9c..fe562b8df 100644 --- a/app/models/report.rb +++ b/app/models/report.rb @@ -29,14 +29,14 @@ class Report < ApplicationRecord submitted: "submitted", in_review: "in_review", awaiting_changes: "awaiting_changes", - approved: "approved", + approved: "approved" } scope :in_historical_order, -> do clauses = [ "reports.financial_year DESC NULLS LAST", "reports.financial_quarter DESC NULLS LAST", - "reports.created_at DESC", + "reports.created_at DESC" ] order(clauses.join(", ")) @@ -84,7 +84,7 @@ def no_unapproved_reports_per_series unless Report.where( fund: fund, - organisation: organisation, + organisation: organisation ).all?(&:approved?) errors.add(:base, I18n.t("activerecord.errors.models.report.unapproved_reports_html")) end diff --git a/app/models/user.rb b/app/models/user.rb index 43b83cce0..6fae988e8 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -6,7 +6,7 @@ class User < ApplicationRecord validates :email, with: :email_cannot_be_changed_after_create, on: :update FORM_FIELD_TRANSLATIONS = { - organisation_id: :organisation, + organisation_id: :organisation }.freeze scope :active, -> { where(active: true) } diff --git a/app/presenters/report_presenter.rb b/app/presenters/report_presenter.rb index 21e2a3c90..f08f488f4 100644 --- a/app/presenters/report_presenter.rb +++ b/app/presenters/report_presenter.rb @@ -58,7 +58,7 @@ def summed_forecasts_for_reportable_activities financial_quarter_and_year, fund.roda_identifier, organisation.beis_organisation_reference, - purpose, + purpose ].compact.join("-") + ".csv" end end diff --git a/app/services/activities/import_from_csv.rb b/app/services/activities/import_from_csv.rb index 329e74ef3..4bdb4eeff 100644 --- a/app/services/activities/import_from_csv.rb +++ b/app/services/activities/import_from_csv.rb @@ -224,7 +224,7 @@ def create class ImplementingOrganisationBuilder FIELDS = { - "implementing_organisation_name" => "Implementing organisation name", + "implementing_organisation_name" => "Implementing organisation name" }.freeze attr_accessor :activity, :row @@ -298,14 +298,14 @@ class Converter objectives: "Aims/Objectives (DP Definition)", beis_identifier: "BEIS ID", uk_dp_named_contact: "UK DP Named Contact", - country_delivery_partners: "NF Partner Country DP", + country_delivery_partners: "NF Partner Country DP" } ALLOWED_BLANK_FIELDS = [ "Implementing organisation reference", "BEIS ID", "UK DP Named Contact (NF)", - "NF Partner Country DP", + "NF Partner Country DP" ] def initialize(row, method = :create) @@ -366,7 +366,7 @@ def convert_gdi(gdi) validate_from_codelist( gdi, "gdi", - I18n.t("importer.errors.activity.invalid_gdi"), + I18n.t("importer.errors.activity.invalid_gdi") ) end @@ -380,13 +380,13 @@ def convert_policy_marker(policy_marker) marker end - alias convert_policy_marker_gender convert_policy_marker - alias convert_policy_marker_climate_change_adaptation convert_policy_marker - alias convert_policy_marker_climate_change_mitigation convert_policy_marker - alias convert_policy_marker_biodiversity convert_policy_marker - alias convert_policy_marker_disability convert_policy_marker - alias convert_policy_marker_disaster_risk_reduction convert_policy_marker - alias convert_policy_marker_nutrition convert_policy_marker + alias_method :convert_policy_marker_gender, :convert_policy_marker + alias_method :convert_policy_marker_climate_change_adaptation, :convert_policy_marker + alias_method :convert_policy_marker_climate_change_mitigation, :convert_policy_marker + alias_method :convert_policy_marker_biodiversity, :convert_policy_marker + alias_method :convert_policy_marker_disability, :convert_policy_marker + alias_method :convert_policy_marker_disaster_risk_reduction, :convert_policy_marker + alias_method :convert_policy_marker_nutrition, :convert_policy_marker def convert_policy_marker_desertification(policy_marker) return "not_assessed" if policy_marker.blank? @@ -421,9 +421,9 @@ def convert_sustainable_development_goal(goal) goal end - alias convert_sdg_1 convert_sustainable_development_goal - alias convert_sdg_2 convert_sustainable_development_goal - alias convert_sdg_3 convert_sustainable_development_goal + alias_method :convert_sdg_1, :convert_sustainable_development_goal + alias_method :convert_sdg_2, :convert_sustainable_development_goal + alias_method :convert_sdg_3, :convert_sustainable_development_goal def convert_benefitting_countries(benefitting_countries) benefitting_countries.split("|").map do |code| @@ -470,7 +470,7 @@ def convert_sector(sector) validate_from_codelist( sector, "sector", - I18n.t("importer.errors.activity.invalid_sector"), + I18n.t("importer.errors.activity.invalid_sector") ) end @@ -478,7 +478,7 @@ def convert_channel_of_delivery_code(channel_of_delivery_code) validate_channel_of_delivery_code( channel_of_delivery_code, "channel_of_delivery_code", - I18n.t("importer.errors.activity.invalid_channel_of_delivery_code"), + I18n.t("importer.errors.activity.invalid_channel_of_delivery_code") ) end @@ -486,7 +486,7 @@ def convert_collaboration_type(collaboration_type) validate_from_codelist( collaboration_type, "collaboration_type", - I18n.t("importer.errors.activity.invalid_collaboration_type"), + I18n.t("importer.errors.activity.invalid_collaboration_type") ) end @@ -494,7 +494,7 @@ def convert_aid_type(aid_type) validate_from_codelist( aid_type, "aid_type", - I18n.t("importer.errors.activity.invalid_aid_type"), + I18n.t("importer.errors.activity.invalid_aid_type") ) end diff --git a/app/services/activity/historical_events_grouper.rb b/app/services/activity/historical_events_grouper.rb index faa5bf45f..38dcb0a68 100644 --- a/app/services/activity/historical_events_grouper.rb +++ b/app/services/activity/historical_events_grouper.rb @@ -12,7 +12,7 @@ def call .group_by { |event| {reference: event.reference, user: event.user&.email, - timestamp: event.created_at.strftime("%d %b %Y at %R"),} + timestamp: event.created_at.strftime("%d %b %Y at %R")} } end diff --git a/app/services/activity/roda_identifier_generator.rb b/app/services/activity/roda_identifier_generator.rb index 092c58ab7..dbb195f35 100644 --- a/app/services/activity/roda_identifier_generator.rb +++ b/app/services/activity/roda_identifier_generator.rb @@ -19,14 +19,14 @@ def programme_identifier [ parent_activity.roda_identifier, extending_organisation.beis_organisation_reference, - component_identifier, + component_identifier ].join("-") end def project_identifier [ parent_activity.roda_identifier, - component_identifier, + component_identifier ].join("-") end diff --git a/app/services/activity/tab.rb b/app/services/activity/tab.rb index ebef9617a..740484d9a 100644 --- a/app/services/activity/tab.rb +++ b/app/services/activity/tab.rb @@ -9,7 +9,7 @@ class Tab "children", "comments", "transfers", - "historical_events", + "historical_events" ].freeze def initialize(activity:, current_user:, tab_name: "financials") diff --git a/app/services/activity/updater.rb b/app/services/activity/updater.rb index db8b35c88..9f43c6581 100644 --- a/app/services/activity/updater.rb +++ b/app/services/activity/updater.rb @@ -45,7 +45,7 @@ def set_sector_category def set_call_dates activity.assign_attributes( call_open_date: format_date(date_params_for("call_open_date")), - call_close_date: format_date(date_params_for("call_close_date")), + call_close_date: format_date(date_params_for("call_close_date")) ) end @@ -96,7 +96,7 @@ def set_policy_markers policy_marker_desertification: params_for("policy_marker_desertification"), policy_marker_disability: params_for("policy_marker_disability"), policy_marker_disaster_risk_reduction: params_for("policy_marker_disaster_risk_reduction"), - policy_marker_nutrition: params_for("policy_marker_nutrition"), + policy_marker_nutrition: params_for("policy_marker_nutrition") ) end @@ -136,7 +136,7 @@ def date_params_for(attribute) { day: date["#{attribute}(3i)"], month: date["#{attribute}(2i)"], - year: date["#{attribute}(1i)"], + year: date["#{attribute}(1i)"] } end diff --git a/app/services/activity/variance_fetcher.rb b/app/services/activity/variance_fetcher.rb index 2e8be4b1f..32acab6b3 100644 --- a/app/services/activity/variance_fetcher.rb +++ b/app/services/activity/variance_fetcher.rb @@ -17,11 +17,9 @@ def total private def activities_with_variance - @activities_with_variance ||= begin - all_activities_for_report.reject { |activity| - activity.variance_for_report_financial_quarter(report: report).zero? - } - end + @activities_with_variance ||= all_activities_for_report.reject { |activity| + activity.variance_for_report_financial_quarter(report: report).zero? + } end def all_activities_for_report diff --git a/app/services/activity_defaults.rb b/app/services/activity_defaults.rb index f1729b0c9..ebebb7014 100644 --- a/app/services/activity_defaults.rb +++ b/app/services/activity_defaults.rb @@ -24,7 +24,7 @@ def call extending_organisation_id: extending_organisation.id, originating_report_id: originating_report&.id, - form_state: form_state, + form_state: form_state } end @@ -74,14 +74,14 @@ def roda_identifier def generate_roda_identifier Activity::RodaIdentifierGenerator.new( parent_activity: parent_activity, - extending_organisation: extending_organisation, + extending_organisation: extending_organisation ).generate end def transparency_identifier [ Organisation::SERVICE_OWNER_IATI_REFERENCE, - roda_identifier, + roda_identifier ].join("-") end diff --git a/app/services/activity_search.rb b/app/services/activity_search.rb index 7b0af7b8c..f8bd8b7cf 100644 --- a/app/services/activity_search.rb +++ b/app/services/activity_search.rb @@ -13,7 +13,7 @@ def results :roda_identifier, :delivery_partner_identifier, :beis_identifier, - :previous_identifier, + :previous_identifier ] result = search_fields diff --git a/app/services/actual/export.rb b/app/services/actual/export.rb index 4b6450f78..d8376d2ae 100644 --- a/app/services/actual/export.rb +++ b/app/services/actual/export.rb @@ -2,7 +2,7 @@ class Actual class Export HEADERS = [ "Activity RODA Identifier", - "Activity BEIS Identifier", + "Activity BEIS Identifier" ] def initialize(activities) diff --git a/app/services/breadcrumb_context.rb b/app/services/breadcrumb_context.rb index 8acc45a72..8994eef7b 100644 --- a/app/services/breadcrumb_context.rb +++ b/app/services/breadcrumb_context.rb @@ -6,7 +6,7 @@ def initialize(session) def set(type:, model:) session[:breadcrumb_context] = { type: type, - model: model, + model: model } end diff --git a/app/services/budget/export.rb b/app/services/budget/export.rb index 1bd7e769e..4ee9fbc15 100644 --- a/app/services/budget/export.rb +++ b/app/services/budget/export.rb @@ -5,7 +5,7 @@ class Export "Delivery partner identifier", "Delivery partner organisation", "Level", - "Title", + "Title" ] def initialize(source_fund:, organisation: nil) @@ -38,7 +38,7 @@ def filename [ source_fund.short_name, @organisation&.beis_organisation_reference, - "budgets.csv", + "budgets.csv" ].reject(&:blank?).join("_") end @@ -52,7 +52,7 @@ def activity_data(activity) activity.delivery_partner_identifier, activity.extending_organisation&.name, I18n.t("table.body.activity.level.#{activity.level}"), - activity.title, + activity.title ] end diff --git a/app/services/create_actual.rb b/app/services/create_actual.rb index b73617d11..8a3d83c5b 100644 --- a/app/services/create_actual.rb +++ b/app/services/create_actual.rb @@ -23,13 +23,11 @@ def call(attributes: {}) actual.report = report end - result = if actual.valid? + if actual.valid? Result.new(actual.save, actual) else Result.new(false, actual) end - - result end private diff --git a/app/services/create_adjustment.rb b/app/services/create_adjustment.rb index 378333435..6fc96a9fb 100644 --- a/app/services/create_adjustment.rb +++ b/app/services/create_adjustment.rb @@ -10,14 +10,12 @@ def call(attributes:) bail_if_report_not_acceptable adjustment = create_adjustment - result = if adjustment.errors.any? + if adjustment.errors.any? Result.new(false, adjustment) else record_historical_event(adjustment) Result.new(true, adjustment) end - - result end private @@ -29,7 +27,7 @@ def create_adjustment adjustment.build_comment( body: attributes.fetch(:comment), commentable: adjustment, - report: report, + report: report ) adjustment.build_detail( user: user, @@ -55,7 +53,7 @@ def adjustment_attrs report: report, value: attributes.fetch(:value), financial_quarter: attributes.fetch(:financial_quarter), - financial_year: attributes.fetch(:financial_year), + financial_year: attributes.fetch(:financial_year) } end @@ -65,7 +63,7 @@ def changes_to_tracked_attributes financial_quarter: [nil, attributes.fetch(:financial_quarter)], financial_year: [nil, attributes.fetch(:financial_year)], comment: [nil, attributes.fetch(:comment)], - adjustment_type: [nil, attributes.fetch(:adjustment_type)], + adjustment_type: [nil, attributes.fetch(:adjustment_type)] } end diff --git a/app/services/create_budget.rb b/app/services/create_budget.rb index e58be43f6..e2913f4b0 100644 --- a/app/services/create_budget.rb +++ b/app/services/create_budget.rb @@ -18,13 +18,11 @@ def call(attributes: {}) budget.report = editable_report_for_activity(activity: activity) end - result = if budget.valid? + if budget.valid? Result.new(budget.save, budget) else Result.new(false, budget) end - - result end private diff --git a/app/services/create_refund.rb b/app/services/create_refund.rb index 46959e99d..c26cf9bac 100644 --- a/app/services/create_refund.rb +++ b/app/services/create_refund.rb @@ -60,7 +60,7 @@ def changes_to_tracked_attributes(refund) value: [nil, refund.value], financial_quarter: [nil, refund.financial_quarter], financial_year: [nil, refund.financial_year], - comment: [nil, refund.comment.body], + comment: [nil, refund.comment.body] } end end diff --git a/app/services/export/report.rb b/app/services/export/report.rb index 92b36914e..f973771ab 100644 --- a/app/services/export/report.rb +++ b/app/services/export/report.rb @@ -67,7 +67,7 @@ def filename @report.own_financial_quarter, @report.fund.source_fund.short_name, @report.organisation.beis_organisation_reference, - "report.csv", + "report.csv" ].reject(&:blank?).join("_") end @@ -110,11 +110,9 @@ def link_rows end def activities - @activities ||= begin - Activity::ProjectsForReportFinder.new( - report: @report, - scope: Activity.all - ).call.order(level: :asc) - end + @activities ||= Activity::ProjectsForReportFinder.new( + report: @report, + scope: Activity.all + ).call.order(level: :asc) end end diff --git a/app/services/export/spending_breakdown.rb b/app/services/export/spending_breakdown.rb index 0c18de4db..069278191 100644 --- a/app/services/export/spending_breakdown.rb +++ b/app/services/export/spending_breakdown.rb @@ -4,7 +4,7 @@ class Export::SpendingBreakdown :delivery_partner_identifier, :title, :level, - :programme_status, + :programme_status ] def initialize(source_fund:, organisation: nil) @@ -49,7 +49,7 @@ def filename [ @source_fund.short_name, @organisation&.beis_organisation_reference, - "spending_breakdown.csv", + "spending_breakdown.csv" ].reject(&:blank?).join("_") end diff --git a/app/services/external_income/export.rb b/app/services/external_income/export.rb index a69eab93c..c69884655 100644 --- a/app/services/external_income/export.rb +++ b/app/services/external_income/export.rb @@ -7,7 +7,7 @@ class Export "Title", "Level", "Providing organisation", - "ODA", + "ODA" ] def initialize(source_fund:, organisation: nil) @@ -31,7 +31,7 @@ def filename [ @source_fund.short_name, @organisation&.beis_organisation_reference, - "external_income.csv", + "external_income.csv" ].reject(&:blank?).join("_") end @@ -43,14 +43,14 @@ def activity_data(activity) activity.delivery_partner_identifier, activity.organisation.name, activity.title, - I18n.t("table.body.activity.level.#{activity.level}"), + I18n.t("table.body.activity.level.#{activity.level}") ] end def external_income_data(external_income) [ external_income.organisation.name, - I18n.t("table.body.external_income.oda_funding.#{external_income.oda_funding?}"), + I18n.t("table.body.external_income.oda_funding.#{external_income.oda_funding?}") ] end diff --git a/app/services/find_project_activities.rb b/app/services/find_project_activities.rb index 3c7e86e5c..3d5d9ad0a 100644 --- a/app/services/find_project_activities.rb +++ b/app/services/find_project_activities.rb @@ -22,12 +22,11 @@ def call ) .order("created_at ASC") - projects = if organisation.service_owner? + if organisation.service_owner? projects.all else projects.where(organisation_id: organisation.id) end - projects end private diff --git a/app/services/forecast_history.rb b/app/services/forecast_history.rb index a70efc04a..5a4e8b2f5 100644 --- a/app/services/forecast_history.rb +++ b/app/services/forecast_history.rb @@ -101,8 +101,7 @@ def create_original_entry(value, report = nil) report: report ) - entry = Forecast.unscoped.create!(attributes) - entry + Forecast.unscoped.create!(attributes) end def revise_entry(entry, value, report = nil) @@ -122,7 +121,7 @@ def record_historical_event(old_entry, new_entry, report) reference: "Revising a forecast for #{old_entry.own_financial_quarter}", activity: new_entry.parent_activity, trackable: new_entry, - report: report, + report: report ) end @@ -139,7 +138,7 @@ def series_attributes { parent_activity: @activity, financial_quarter: @financial_quarter, - financial_year: @financial_year, + financial_year: @financial_year } end @@ -153,7 +152,7 @@ def required_attributes providing_organisation_name: service_owner.name, providing_organisation_type: service_owner.organisation_type, providing_organisation_reference: service_owner.iati_reference, - currency: @activity.organisation.default_currency, + currency: @activity.organisation.default_currency } end @@ -162,7 +161,7 @@ def period_start_and_end_dates [ quarter.start_date, - quarter.end_date, + quarter.end_date ] end end diff --git a/app/services/history_recorder.rb b/app/services/history_recorder.rb index 2c905e996..31cb1ebc4 100644 --- a/app/services/history_recorder.rb +++ b/app/services/history_recorder.rb @@ -18,7 +18,7 @@ def call(changes:, reference:, activity:, trackable:, report: nil) reference: reference, value_changed: value_changed, previous_value: previous_value, - new_value: new_value, + new_value: new_value ) end end diff --git a/app/services/import/commitments.rb b/app/services/import/commitments.rb index 85642f987..8e80881e2 100644 --- a/app/services/import/commitments.rb +++ b/app/services/import/commitments.rb @@ -12,7 +12,7 @@ def initialize(message, row_number) "RODA identifier", "Commitment value", "Financial quarter", - "Financial year", + "Financial year" ] attr_reader :errors, :imported, :user @@ -57,7 +57,7 @@ def import_rows_from_csv(csv) def record_history imported.each do |commitment| changes = { - value: [nil, commitment.value], + value: [nil, commitment.value] } HistoryRecorder.new(user: user).call( changes: changes, diff --git a/app/services/import_actuals.rb b/app/services/import_actuals.rb index 1ec69f610..f85457035 100644 --- a/app/services/import_actuals.rb +++ b/app/services/import_actuals.rb @@ -116,7 +116,7 @@ class Converter value: "Value", receiving_organisation_name: "Receiving Organisation Name", receiving_organisation_type: "Receiving Organisation Type", - receiving_organisation_reference: "Receiving Organisation IATI Reference", + receiving_organisation_reference: "Receiving Organisation IATI Reference" } attr_reader :activity, :errors @@ -153,7 +153,7 @@ def convert_to_attribute(attr_name, value) rescue Encoding::CompatibilityError @errors[attr_name] = [ original_value.force_encoding("UTF-8"), - I18n.t("importer.errors.actual.invalid_characters"), + I18n.t("importer.errors.actual.invalid_characters") ] nil rescue => error @@ -175,7 +175,7 @@ def convert_receiving_organisation_type(type) validate_from_codelist( type, "organisation_type", - I18n.t("importer.errors.actual.invalid_iati_organisation_type"), + I18n.t("importer.errors.actual.invalid_iati_organisation_type") ) end diff --git a/app/services/import_converter.rb b/app/services/import_converter.rb index 63496d556..781bf8076 100644 --- a/app/services/import_converter.rb +++ b/app/services/import_converter.rb @@ -2,14 +2,14 @@ class ImportConverter TRANSACTION_HEADER_PATTERNS = [ /^Act +(?\d{4})\/\d{2} +FY +Q(?[1-4]) +\(.*\)$/, /^Act +(?\d{4})\/\d{2} +Q(?[1-4])$/, - /^Q(?[1-4]) +(?\d{4})-\d{4} actuals$/, + /^Q(?[1-4]) +(?\d{4})-\d{4} actuals$/ ] FORECAST_HEADER_PATTERNS = [ /^FC +Q(?[1-4]) +(?\d{4})-\d{2}$/, /^FC +Q(?[1-4]) +(?\d{4})$/, /^FC +(?\d{4})\/\d{2} +FY +Q(?[1-4]) +\(.*\)$/, - /^Q(?[1-4]) +(?\d{4})-\d{4} forecast$/, + /^Q(?[1-4]) +(?\d{4})-\d{4} forecast$/ ] IDENTIFIER_HEADERS = ["Activity RODA Identifier"] diff --git a/app/services/import_forecasts.rb b/app/services/import_forecasts.rb index 2b2e1b16a..4648abd57 100644 --- a/app/services/import_forecasts.rb +++ b/app/services/import_forecasts.rb @@ -15,7 +15,7 @@ def csv_row COLUMN_HEADINGS = [ "Activity Name", "Activity Delivery Partner Identifier", - RODA_ID_KEY, + RODA_ID_KEY ] class Generator @@ -40,7 +40,7 @@ def csv_row(activity) [ activity.title, activity.delivery_partner_identifier, - activity.roda_identifier, + activity.roda_identifier ] + forecast_values end end @@ -149,7 +149,7 @@ def log_report_not_latest_error(latest_report) message = [ "The report #{@report.id} (#{report_organisation}, #{quarter @report} for #{report_fund},", "#{@report.state}) is not the latest for that organisation and fund.", - "The latest is #{latest_report.id}, for #{quarter latest_report} (#{latest_report.state}).", + "The latest is #{latest_report.id}, for #{quarter latest_report} (#{latest_report.state})." ] @errors << Error.new(nil, nil, nil, message.join(" ")) diff --git a/app/services/quarterly_actual_export.rb b/app/services/quarterly_actual_export.rb index a02223872..54007dc9c 100644 --- a/app/services/quarterly_actual_export.rb +++ b/app/services/quarterly_actual_export.rb @@ -1,7 +1,7 @@ class QuarterlyActualExport HEADERS = [ "Activity RODA Identifier", - "Activity BEIS Identifier", + "Activity BEIS Identifier" ] def initialize(activities) diff --git a/app/services/report/export.rb b/app/services/report/export.rb index db2839dbe..f62de75e3 100644 --- a/app/services/report/export.rb +++ b/app/services/report/export.rb @@ -22,7 +22,7 @@ def rows previous_report_quarters: previous_report_quarters, following_report_quarters: following_report_quarters, actual_quarters: actual_quarters, - refund_quarters: refund_quarters, + refund_quarters: refund_quarters ).call end end @@ -36,12 +36,10 @@ def filename attr_reader :report def activities - @activities ||= begin - Activity::ProjectsForReportFinder.new( - report: report, - scope: Activity.all - ).call.sort_by { |a| a.level } - end + @activities ||= Activity::ProjectsForReportFinder.new( + report: report, + scope: Activity.all + ).call.sort_by { |a| a.level } end def actual_quarters @@ -141,14 +139,14 @@ class Row "Disaster Risk Reduction" => :policy_marker_disaster_risk_reduction, "Nutrition policy" => :policy_marker_nutrition, "Implementing organisations" => :implementing_organisations, - "Tied status" => :tied_status_with_code, + "Tied status" => :tied_status_with_code } VARIANCE_HEADERS = [ "Comment", "Source fund", "Delivery partner short name", - "Link to activity in RODA", + "Link to activity in RODA" ] def initialize(activity:, report_presenter:, previous_report_quarters:, following_report_quarters:, actual_quarters:, refund_quarters:, change_state:) @@ -179,7 +177,7 @@ def previous_quarter_actuals_and_refunds previous_report_quarters.map { |quarter| [ actual_value(quarter), - refund_value(quarter), + refund_value(quarter) ] }.flatten end @@ -197,7 +195,7 @@ def variance_data activity_presenter.comments_for_report(report_id: report_presenter.id).map(&:body).join("\n"), activity_presenter.source_fund&.name, activity_presenter.extending_organisation&.beis_organisation_reference, - activity_presenter.link_to_roda, + activity_presenter.link_to_roda ] end diff --git a/app/services/report/grouped_comments_fetcher.rb b/app/services/report/grouped_comments_fetcher.rb index 634ede02c..d62213c4b 100644 --- a/app/services/report/grouped_comments_fetcher.rb +++ b/app/services/report/grouped_comments_fetcher.rb @@ -20,8 +20,8 @@ def comments commentable: [ :parent_activity, parent: [ - parent: [:parent], - ], + parent: [:parent] + ] ] ) else diff --git a/app/services/update_budget.rb b/app/services/update_budget.rb index ea2d2a63b..b05190e7f 100644 --- a/app/services/update_budget.rb +++ b/app/services/update_budget.rb @@ -11,15 +11,13 @@ def call(attributes: {}) convert_and_assign_value(budget, attributes[:value]) - result = if budget.valid? + if budget.valid? result = Result.new(budget.save, budget) record_historical_event(attributes) if result.success? result else Result.new(false, budget) end - - result end private @@ -45,7 +43,7 @@ def changes_to_tracked_attributes :financial_year, :providing_organisation_name, :providing_organisation_type, - :providing_organisation_reference, + :providing_organisation_reference ].filter_map { |attribute| [attribute, budget.saved_change_to_attribute(attribute)] if budget.saved_change_to_attribute?(attribute) }.to_h diff --git a/app/services/update_user_in_auth0.rb b/app/services/update_user_in_auth0.rb index 9db3fb957..5669488fc 100644 --- a/app/services/update_user_in_auth0.rb +++ b/app/services/update_user_in_auth0.rb @@ -13,7 +13,7 @@ def call auth0_client.update_user( user.identifier, email: user.email, - name: user.name, + name: user.name ) end diff --git a/config/application.rb b/config/application.rb index 37ea0da7c..92355e07c 100644 --- a/config/application.rb +++ b/config/application.rb @@ -55,7 +55,7 @@ class Application < Rails::Application config.action_mailer.delivery_method = :notify config.action_mailer.deliver_later_queue_name = "mailers" config.action_mailer.notify_settings = { - api_key: ENV["NOTIFY_KEY"], + api_key: ENV["NOTIFY_KEY"] } config.action_mailer.default_url_options = {host: ENV["DOMAIN"]} diff --git a/config/environments/development.rb b/config/environments/development.rb index 522cdc73d..c646fc243 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -24,7 +24,7 @@ config.cache_store = :memory_store config.public_file_server.headers = { - "Cache-Control" => "public, max-age=#{2.days.to_i}", + "Cache-Control" => "public, max-age=#{2.days.to_i}" } else config.action_controller.perform_caching = false diff --git a/config/environments/production.rb b/config/environments/production.rb index 831961eb1..6922344f5 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -3,7 +3,7 @@ require "active_support/core_ext/integer/time" # Load environment variables that are created by Terraform -require_relative "../../lib/vcap_parser.rb" +require_relative "../../lib/vcap_parser" VcapParser.load_service_environment_variables! Rails.application.configure do @@ -102,7 +102,7 @@ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') if ENV["RAILS_LOG_TO_STDOUT"].present? - logger = ActiveSupport::Logger.new(STDOUT) + logger = ActiveSupport::Logger.new($stdout) logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new(logger) end diff --git a/config/environments/test.rb b/config/environments/test.rb index 7579937bf..3c8f04cfa 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -26,7 +26,7 @@ # Configure public file server for tests with Cache-Control for performance. config.public_file_server.enabled = true config.public_file_server.headers = { - "Cache-Control" => "public, max-age=#{1.hour.to_i}", + "Cache-Control" => "public, max-age=#{1.hour.to_i}" } # Show full error reports and disable caching. @@ -96,6 +96,6 @@ config.hosts = [ /test.local/, - /localhost/, + /localhost/ ] end diff --git a/config/initializers/auth0.rb b/config/initializers/auth0.rb index 03b8733ba..6d11954ac 100644 --- a/config/initializers/auth0.rb +++ b/config/initializers/auth0.rb @@ -6,7 +6,7 @@ ENV["AUTH0_DOMAIN"], callback_path: "/auth/oauth2/callback", authorize_params: { - scope: "openid email profile", + scope: "openid email profile" } ) end diff --git a/config/initializers/dotenv.rb b/config/initializers/dotenv.rb index cdba8c075..fd90c8bcf 100644 --- a/config/initializers/dotenv.rb +++ b/config/initializers/dotenv.rb @@ -8,6 +8,6 @@ "SECRET_KEY_BASE", "AUTH0_CLIENT_ID", "AUTH0_CLIENT_SECRET", - "AUTH0_DOMAIN", + "AUTH0_DOMAIN" ) end diff --git a/config/initializers/form_builder.rb b/config/initializers/form_builder.rb index 888a41021..d9583cd24 100644 --- a/config/initializers/form_builder.rb +++ b/config/initializers/form_builder.rb @@ -45,6 +45,7 @@ def has_errors? end end end + module RodaFormBuilder module Elements class Select < GOVUKDesignSystemFormBuilder::Base diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 099ddde2c..63affe5b9 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -5,11 +5,11 @@ host: redis_uri.host, port: redis_uri.port, db: 1, - namespace: "roda:session", + namespace: "roda:session" }, key: "_roda_session", expire_after: 12.hours, - threadsafe: true, + threadsafe: true } redis_store_params[:secure] = true if Rails.env.production? Rails.application.config.session_store :redis_store, redis_store_params diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index f32f469d8..f70e9a606 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -1,7 +1,7 @@ redis_url = ENV["REDIS_URL"] options = { - concurrency: Integer(ENV.fetch("RAILS_MAX_THREADS") { 5 }), + concurrency: Integer(ENV.fetch("RAILS_MAX_THREADS", 5)) } Sidekiq.configure_server do |config| @@ -9,7 +9,7 @@ config.options.merge!(options) config.redis = { url: redis_url, - size: config.options[:concurrency] + 5, + size: config.options[:concurrency] + 5 } end @@ -17,6 +17,6 @@ config.options.merge!(options) config.redis = { url: redis_url, - size: config.options[:concurrency] + 5, + size: config.options[:concurrency] + 5 } end diff --git a/config/puma.rb b/config/puma.rb index 0d84ae97a..41751505b 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -6,20 +6,20 @@ # the maximum value specified for Puma. Default is set to 5 threads for minimum # and maximum; this matches the default thread size of Active Record. # -threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +threads_count = ENV.fetch("RAILS_MAX_THREADS", 5) threads threads_count, threads_count # Specifies the `port` that Puma will listen on to receive requests; default is 3000. # -port ENV.fetch("PORT") { 3000 } +port ENV.fetch("PORT", 3000) # Specifies the `environment` that Puma will run in. # -environment ENV.fetch("RAILS_ENV") { "development" } +environment ENV.fetch("RAILS_ENV", "development") # Specifies the `pidfile` that Puma will use. # -pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } +pidfile ENV.fetch("PIDFILE", "tmp/pids/server.pid") # Specifies the number of `workers` to boot in clustered mode. # Workers are forked webserver processes. If using threads and workers together diff --git a/db/data/20210823135218_set_nil_policy_markers_to_default.rb b/db/data/20210823135218_set_nil_policy_markers_to_default.rb index ea9a13b64..31be84b80 100644 --- a/db/data/20210823135218_set_nil_policy_markers_to_default.rb +++ b/db/data/20210823135218_set_nil_policy_markers_to_default.rb @@ -8,7 +8,7 @@ "desertification", "disability", "disaster_risk_reduction", - "nutrition", + "nutrition" ].each do |policy_marker_category| key = "policy_marker_#{policy_marker_category}" Activity.where("#{key}": nil).update_all("#{key}": "not_assessed") diff --git a/db/data/20211005131155_move_legacy_comments_to_comments.rb b/db/data/20211005131155_move_legacy_comments_to_comments.rb index 033ae3a0a..c445dd458 100644 --- a/db/data/20211005131155_move_legacy_comments_to_comments.rb +++ b/db/data/20211005131155_move_legacy_comments_to_comments.rb @@ -27,7 +27,7 @@ owner_id: legacy_comment.owner_id, report_id: legacy_comment.report_id, created_at: legacy_comment.created_at, - updated_at: legacy_comment.updated_at, + updated_at: legacy_comment.updated_at ) created_comments << legacy_comment diff --git a/db/data/20211207144100_delete_unwanted_budgets.rb b/db/data/20211207144100_delete_unwanted_budgets.rb index 3b9c8811d..ca5f65611 100644 --- a/db/data/20211207144100_delete_unwanted_budgets.rb +++ b/db/data/20211207144100_delete_unwanted_budgets.rb @@ -20,7 +20,7 @@ def find(organisation_name:, fund:, level:) targets = [ {organisation_name: "AMS", fund: "Newton", level: "project"}, {organisation_name: "RS", fund: "Newton", level: "project"}, - {organisation_name: "UKSA", fund: "GCRF", level: "third_party_project"}, + {organisation_name: "UKSA", fund: "GCRF", level: "third_party_project"} ] targets.each do |target| diff --git a/db/data/20220106163037_remove_actuals_from_given_activities.rb b/db/data/20220106163037_remove_actuals_from_given_activities.rb index d6b759e9e..0aa73bc58 100644 --- a/db/data/20220106163037_remove_actuals_from_given_activities.rb +++ b/db/data/20220106163037_remove_actuals_from_given_activities.rb @@ -64,7 +64,7 @@ earliest_actual, latest_actual, refunds.count, - adjustments.count, + adjustments.count ] actuals_for_deletion.each do |actual| @@ -74,7 +74,7 @@ actual.id, actual.value.to_s, actual.date.to_s, - actual.financial_quarter_and_year, + actual.financial_quarter_and_year ] puts "deleting actual #{actual.id}" actual.destroy! diff --git a/db/seeds/activity.rb b/db/seeds/activity.rb index fa1db3d86..c8a57256c 100644 --- a/db/seeds/activity.rb +++ b/db/seeds/activity.rb @@ -78,7 +78,7 @@ Activity.fund, Activity.programme, Activity.project, - Activity.third_party_project, + Activity.third_party_project ].each do |set| set.each do |activity| activity.save! diff --git a/db/seeds/development_users.rb b/db/seeds/development_users.rb index 34aaf640d..fdf560365 100644 --- a/db/seeds/development_users.rb +++ b/db/seeds/development_users.rb @@ -1,12 +1,12 @@ administrator = User.find_or_create_by( name: "Administrator", email: "roda@dxw.com", - identifier: "auth0|5dc53e4b85758e0e95b062f0", + identifier: "auth0|5dc53e4b85758e0e95b062f0" ) delivery_partner = User.find_or_create_by( name: "Delivery Partner", email: "roda+dp@dxw.com", - identifier: "auth0|5e5e1ee731555a0cb0ab5a75", + identifier: "auth0|5e5e1ee731555a0cb0ab5a75" ) beis = Organisation.service_owner administrator.organisation = beis diff --git a/db/seeds/organisations.rb b/db/seeds/organisations.rb index 672fd9a1c..659b0cb27 100644 --- a/db/seeds/organisations.rb +++ b/db/seeds/organisations.rb @@ -8,7 +8,7 @@ organisation_type: organisation["type"], language_code: "en", default_currency: "gbp", - role: organisation["role"], + role: organisation["role"] } Organisation.find_or_create_by(iati_reference: organisation["reference"]).update!(organisation_params) end diff --git a/db/seeds/pentest_users.rb b/db/seeds/pentest_users.rb index 6897f44e9..26f72ee3a 100644 --- a/db/seeds/pentest_users.rb +++ b/db/seeds/pentest_users.rb @@ -1,12 +1,12 @@ administrator = User.find_or_create_by( name: "Administrator", email: "roda@dxw.com", - identifier: "auth0|5e7e3a08c888910c634232b3", + identifier: "auth0|5e7e3a08c888910c634232b3" ) delivery_partner = User.find_or_create_by( name: "Delivery Partner", email: "roda+dp@dxw.com", - identifier: "auth0|5e7e39e391c2560c6426bda9", + identifier: "auth0|5e7e39e391c2560c6426bda9" ) beis = Organisation.service_owner administrator.organisation = beis diff --git a/db/seeds/staging_users.rb b/db/seeds/staging_users.rb index 887472cef..7d47fcae1 100644 --- a/db/seeds/staging_users.rb +++ b/db/seeds/staging_users.rb @@ -1,12 +1,12 @@ administrator = User.find_or_create_by( name: "Administrator", email: "roda@dxw.com", - identifier: "auth0|5dc54a826560de0e885bb41b", + identifier: "auth0|5dc54a826560de0e885bb41b" ) delivery_partner = User.find_or_create_by( name: "Delivery Partner", email: "roda+dp@dxw.com", - identifier: "auth0|5e554c1b37de640d5dd3ea61", + identifier: "auth0|5e554c1b37de640d5dd3ea61" ) beis = Organisation.service_owner administrator.organisation = beis diff --git a/lib/auth0_api.rb b/lib/auth0_api.rb index abec3b80f..3f40108b4 100644 --- a/lib/auth0_api.rb +++ b/lib/auth0_api.rb @@ -18,7 +18,7 @@ def new_client client_id: ENV["AUTH0_CLIENT_ID"], domain: ENV["AUTH0_DOMAIN"], token: token, - api_version: 2, + api_version: 2 ) end @@ -32,7 +32,7 @@ def token_data grant_type: "client_credentials", client_id: ENV["AUTH0_CLIENT_ID"], client_secret: ENV["AUTH0_CLIENT_SECRET"], - audience: "https://#{ENV["AUTH0_DOMAIN"]}/api/v2/", + audience: "https://#{ENV["AUTH0_DOMAIN"]}/api/v2/" ) response = http.request(request) JSON.parse(response.read_body) diff --git a/lib/roda_form_builder/form_builder.rb b/lib/roda_form_builder/form_builder.rb index 7c52c85f3..4e7b49e87 100644 --- a/lib/roda_form_builder/form_builder.rb +++ b/lib/roda_form_builder/form_builder.rb @@ -13,7 +13,7 @@ def with_guidance(attribute_name, html) doc.xpath("div").first.add_child(content_tag(:p, class: "guidance") { [ "For help responding to this question, refer to the", - link_to_new_tab("guidance", guidance_url), + link_to_new_tab("guidance", guidance_url) ].join(" ").html_safe }) @@ -34,7 +34,7 @@ def with_guidance(attribute_name, html) :govuk_collection_select, :govuk_collection_radio_buttons, :govuk_collection_check_boxes, - :govuk_date_field, + :govuk_date_field ].each do |method| define_method(method) do |attribute_name, *args, &block| with_guidance(attribute_name, super(attribute_name, *args)) diff --git a/lib/tasks/delete_activity.rake b/lib/tasks/delete_activity.rake index 65a65be44..6a4820573 100644 --- a/lib/tasks/delete_activity.rake +++ b/lib/tasks/delete_activity.rake @@ -44,7 +44,7 @@ namespace :activities do Kernel.puts "# implementing organisations: #{implementing_organisations.count}\n" Kernel.puts "\nAre you sure you want to delete this activity, all descendants and associated entities? [y/n]\n" - answer = STDIN.gets.chomp + answer = $stdin.gets.chomp case answer when "y" delete_activity(activity_id: activity.id) diff --git a/script/import_forecasts.rb b/script/import_forecasts.rb index 8c3a842fe..fec6e44f8 100644 --- a/script/import_forecasts.rb +++ b/script/import_forecasts.rb @@ -34,7 +34,7 @@ def zero_option_to_nil(options, field) fund: fund, organisation: organisation, financial_quarter: zero_option_to_nil(options, :quarter), - financial_year: zero_option_to_nil(options, :year), + financial_year: zero_option_to_nil(options, :year) ) unless report diff --git a/spec/controllers/concerns/reports/breadcrumbed_spec.rb b/spec/controllers/concerns/reports/breadcrumbed_spec.rb index c9f1acfe0..54c989348 100644 --- a/spec/controllers/concerns/reports/breadcrumbed_spec.rb +++ b/spec/controllers/concerns/reports/breadcrumbed_spec.rb @@ -35,7 +35,7 @@ def show expect(session[:breadcrumb_context]).to eq({ type: :report, - model: report, + model: report }) end end @@ -66,7 +66,7 @@ def show expect(session[:breadcrumb_context]).to eq({ type: :report, - model: report, + model: report }) end end diff --git a/spec/controllers/staff/activities_controller_spec.rb b/spec/controllers/staff/activities_controller_spec.rb index 652f9db88..805993913 100644 --- a/spec/controllers/staff/activities_controller_spec.rb +++ b/spec/controllers/staff/activities_controller_spec.rb @@ -40,9 +40,9 @@ { fund => { programme => { - project => third_party_projects, - }, - }, + project => third_party_projects + } + } } end diff --git a/spec/controllers/staff/activity_forms_controller_spec.rb b/spec/controllers/staff/activity_forms_controller_spec.rb index 394dc33a2..2929dcf98 100644 --- a/spec/controllers/staff/activity_forms_controller_spec.rb +++ b/spec/controllers/staff/activity_forms_controller_spec.rb @@ -182,7 +182,7 @@ let(:expected_changes) do { "title" => ["Original title", "Updated title"], - "description" => ["Original description", "Updated description"], + "description" => ["Original description", "Updated description"] } end diff --git a/spec/controllers/staff/actual_uploads_controller_spec.rb b/spec/controllers/staff/actual_uploads_controller_spec.rb index ae12fa8ff..3e8a854ac 100644 --- a/spec/controllers/staff/actual_uploads_controller_spec.rb +++ b/spec/controllers/staff/actual_uploads_controller_spec.rb @@ -80,11 +80,11 @@ let!(:third_party_project_e) { create(:third_party_project_activity, parent: project_c, organisation: report.organisation, roda_identifier: "A-A-C-E", created_at: rand(0..60).minutes.ago) } let!(:third_party_project_f) { create(:third_party_project_activity, parent: project_c, organisation: report.organisation, roda_identifier: "A-B-D-F", created_at: rand(0..60).minutes.ago) } - let!(:stopped_project) { create(:project_activity, parent: programme_a, organisation: report.organisation, programme_status: "stopped",) } - let!(:cancelled_project) { create(:project_activity, parent: programme_b, organisation: report.organisation, programme_status: "cancelled",) } - let!(:completed_project) { create(:project_activity, parent: programme_a, organisation: report.organisation, programme_status: "completed",) } - let!(:paused_project) { create(:project_activity, parent: programme_b, organisation: report.organisation, programme_status: "paused",) } - let!(:ineligible_project) { create(:project_activity, parent: programme_b, organisation: report.organisation, oda_eligibility: 2,) } + let!(:stopped_project) { create(:project_activity, parent: programme_a, organisation: report.organisation, programme_status: "stopped") } + let!(:cancelled_project) { create(:project_activity, parent: programme_b, organisation: report.organisation, programme_status: "cancelled") } + let!(:completed_project) { create(:project_activity, parent: programme_a, organisation: report.organisation, programme_status: "completed") } + let!(:paused_project) { create(:project_activity, parent: programme_b, organisation: report.organisation, programme_status: "paused") } + let!(:ineligible_project) { create(:project_activity, parent: programme_b, organisation: report.organisation, oda_eligibility: 2) } it "returns activities in a predictable order" do get :show, params: {report_id: report.id} diff --git a/spec/controllers/staff/actuals_controller_spec.rb b/spec/controllers/staff/actuals_controller_spec.rb index 0bec97bd4..47cf13db5 100644 --- a/spec/controllers/staff/actuals_controller_spec.rb +++ b/spec/controllers/staff/actuals_controller_spec.rb @@ -29,7 +29,7 @@ params = { actual: {value: "200.02", financial_quarter: "2"}, activity_id: "abc123", - id: "xyz321", + id: "xyz321" } put :update, params: params diff --git a/spec/controllers/staff/exports/organisations_controller_spec.rb b/spec/controllers/staff/exports/organisations_controller_spec.rb index 00aae51cc..75d27eff5 100644 --- a/spec/controllers/staff/exports/organisations_controller_spec.rb +++ b/spec/controllers/staff/exports/organisations_controller_spec.rb @@ -4,7 +4,7 @@ shared_examples "renders XML" do it "sets the XML headers correctly" do expect(response.headers.to_h).to include({ - "Content-Disposition" => "attachment; filename=\"GB-GOV-ADTJQ.xml\"", + "Content-Disposition" => "attachment; filename=\"GB-GOV-ADTJQ.xml\"" }) end @@ -26,7 +26,7 @@ it "sets the CSV headers correctly" do expect(response.headers.to_h).to include({ - "Content-Type" => "text/csv", + "Content-Type" => "text/csv" }) end end diff --git a/spec/controllers/staff/exports_controller_spec.rb b/spec/controllers/staff/exports_controller_spec.rb index 69cd0d4de..eec8c114f 100644 --- a/spec/controllers/staff/exports_controller_spec.rb +++ b/spec/controllers/staff/exports_controller_spec.rb @@ -30,7 +30,7 @@ it "sets the CSV headers correctly" do expect(response.headers.to_h).to include({ - "Content-Type" => "text/csv", + "Content-Type" => "text/csv" }) end @@ -62,7 +62,7 @@ it "sets the CSV headers correctly" do expect(response.headers.to_h).to include({ - "Content-Type" => "text/csv", + "Content-Type" => "text/csv" }) end diff --git a/spec/controllers/staff/home_controller_spec.rb b/spec/controllers/staff/home_controller_spec.rb index 1a30b98bf..76d42b728 100644 --- a/spec/controllers/staff/home_controller_spec.rb +++ b/spec/controllers/staff/home_controller_spec.rb @@ -31,9 +31,9 @@ { fund => { programme => { - project => third_party_projects, - }, - }, + project => third_party_projects + } + } } end diff --git a/spec/factories/activity.rb b/spec/factories/activity.rb index 1fc512a30..914da550b 100644 --- a/spec/factories/activity.rb +++ b/spec/factories/activity.rb @@ -36,7 +36,7 @@ if activity.roda_identifier.blank? && activity.parent.present? activity.roda_identifier = Activity::RodaIdentifierGenerator.new( parent_activity: activity.parent, - extending_organisation: activity.extending_organisation, + extending_organisation: activity.extending_organisation ).generate end end diff --git a/spec/features/staff/beis_users_can_download_exports_spec.rb b/spec/features/staff/beis_users_can_download_exports_spec.rb index b747fe7b9..f38035cc5 100644 --- a/spec/features/staff/beis_users_can_download_exports_spec.rb +++ b/spec/features/staff/beis_users_can_download_exports_spec.rb @@ -17,8 +17,8 @@ { "Activity RODA Identifier" => project.roda_identifier, "Activity BEIS Identifier" => project.beis_identifier, - "FQ3 2019-2020" => "150.00", - }, + "FQ3 2019-2020" => "150.00" + } ]) end @@ -49,7 +49,7 @@ "FQ2 2020-2021" => "0.00", "FQ3 2020-2021" => "0.00", "FQ4 2020-2021" => "0.00", - "FQ1 2021-2022" => "0.00", + "FQ1 2021-2022" => "0.00" }, { "RODA identifier" => project.roda_identifier, @@ -65,8 +65,8 @@ "FQ2 2020-2021" => "0.00", "FQ3 2020-2021" => "0.00", "FQ4 2020-2021" => "0.00", - "FQ1 2021-2022" => "240.00", - }, + "FQ1 2021-2022" => "240.00" + } ]) end @@ -102,7 +102,7 @@ "FQ3 2020-2021" => "0.00", "FQ4 2020-2021" => "0.00", "FQ1 2021-2022" => "0.00", - "FQ2 2021-2022" => "0.00", + "FQ2 2021-2022" => "0.00" }, { "RODA identifier" => project2.roda_identifier, @@ -119,7 +119,7 @@ "FQ3 2020-2021" => "0.00", "FQ4 2020-2021" => "0.00", "FQ1 2021-2022" => "240.00", - "FQ2 2021-2022" => "0.00", + "FQ2 2021-2022" => "0.00" }, { "RODA identifier" => project2.roda_identifier, @@ -136,8 +136,8 @@ "FQ3 2020-2021" => "0.00", "FQ4 2020-2021" => "0.00", "FQ1 2021-2022" => "0.00", - "FQ2 2021-2022" => "100.00", - }, + "FQ2 2021-2022" => "100.00" + } ]) end @@ -171,8 +171,8 @@ "2018-2019" => "100.00", "2019-2020" => "80.00", "2020-2021" => "75.00", - "2021-2022" => "20.00", - }, + "2021-2022" => "20.00" + } ]) end @@ -212,7 +212,7 @@ "2018-2019" => "100.00", "2019-2020" => "80.00", "2020-2021" => "0.00", - "2021-2022" => "20.00", + "2021-2022" => "20.00" }, { "RODA identifier" => project2.roda_identifier, @@ -223,7 +223,7 @@ "2018-2019" => "100.00", "2019-2020" => "80.00", "2020-2021" => "75.00", - "2021-2022" => "20.00", + "2021-2022" => "20.00" }, { "RODA identifier" => project2.roda_identifier, @@ -234,8 +234,8 @@ "2018-2019" => "0.00", "2019-2020" => "0.00", "2020-2021" => "0.00", - "2021-2022" => "60.00", - }, + "2021-2022" => "60.00" + } ]) end end diff --git a/spec/features/staff/beis_users_can_view_other_users_spec.rb b/spec/features/staff/beis_users_can_view_other_users_spec.rb index cae7b7fb1..67de39af0 100644 --- a/spec/features/staff/beis_users_can_view_other_users_spec.rb +++ b/spec/features/staff/beis_users_can_view_other_users_spec.rb @@ -57,7 +57,7 @@ a2_user.organisation.name, b1_user.organisation.name, b2_user.organisation.name, - user.organisation.name, + user.organisation.name ].sort expect(page.all("td.organisation").collect(&:text)).to match_array(expected_array) diff --git a/spec/features/staff/users_can_create_a_project_level_activity_spec.rb b/spec/features/staff/users_can_create_a_project_level_activity_spec.rb index f15a21124..6215db4a7 100644 --- a/spec/features/staff/users_can_create_a_project_level_activity_spec.rb +++ b/spec/features/staff/users_can_create_a_project_level_activity_spec.rb @@ -21,7 +21,7 @@ country_delivery_partners: ["National Council for the State Funding Agencies (CONFAP)"], benefitting_countries: ["AG", "HT"], sdgs_apply: true, - sdg_1: 5,) + sdg_1: 5) visit activities_path click_on programme.title diff --git a/spec/features/staff/users_can_create_a_third_party_project_level_activity_spec.rb b/spec/features/staff/users_can_create_a_third_party_project_level_activity_spec.rb index 31d64d2ad..1de737005 100644 --- a/spec/features/staff/users_can_create_a_third_party_project_level_activity_spec.rb +++ b/spec/features/staff/users_can_create_a_third_party_project_level_activity_spec.rb @@ -24,7 +24,7 @@ country_delivery_partners: ["National Council for the State Funding Agencies (CONFAP)"], benefitting_countries: ["AG", "HT"], sdgs_apply: true, - sdg_1: 5,) + sdg_1: 5) visit activities_path diff --git a/spec/features/staff/users_can_edit_a_refund_spec.rb b/spec/features/staff/users_can_edit_a_refund_spec.rb index 80d47c863..e75daeaac 100644 --- a/spec/features/staff/users_can_edit_a_refund_spec.rb +++ b/spec/features/staff/users_can_edit_a_refund_spec.rb @@ -32,7 +32,7 @@ }.to({ "financial_year" => 2019, "financial_quarter" => 4, - "value" => BigDecimal("-100"), + "value" => BigDecimal("-100") }).and change { refund.comment.reload.body }.to("Comment goes here") expect(page).to have_content(t("action.refund.update.success")) diff --git a/spec/features/staff/users_can_edit_an_actual_spec.rb b/spec/features/staff/users_can_edit_an_actual_spec.rb index 246261e1f..f20fdc42a 100644 --- a/spec/features/staff/users_can_edit_an_actual_spec.rb +++ b/spec/features/staff/users_can_edit_an_actual_spec.rb @@ -25,7 +25,7 @@ fill_in_actual_form( value: "2000.51", financial_quarter: "4", - financial_year: "2019-2020", + financial_year: "2019-2020" ) expect(page).to have_content(t("action.actual.update.success")) diff --git a/spec/features/staff/users_can_upload_activities_spec.rb b/spec/features/staff/users_can_upload_activities_spec.rb index 3cc89d5c9..814813ac5 100644 --- a/spec/features/staff/users_can_upload_activities_spec.rb +++ b/spec/features/staff/users_can_upload_activities_spec.rb @@ -54,7 +54,7 @@ "Transparency identifier", "UK DP Named Contact", "NF Partner Country DP", - "Benefitting Countries", + "Benefitting Countries" ]) end diff --git a/spec/features/staff/users_can_upload_actuals_spec.rb b/spec/features/staff/users_can_upload_actuals_spec.rb index d22665739..807a3f46e 100644 --- a/spec/features/staff/users_can_upload_actuals_spec.rb +++ b/spec/features/staff/users_can_upload_actuals_spec.rb @@ -56,7 +56,7 @@ def expect_to_see_successful_upload_summary_with(count:, total:) "Value" => "0.00", "Receiving Organisation Name" => nil, "Receiving Organisation Type" => nil, - "Receiving Organisation IATI Reference" => nil, + "Receiving Organisation IATI Reference" => nil }, { "Activity Name" => sibling_project.title, @@ -67,8 +67,8 @@ def expect_to_see_successful_upload_summary_with(count:, total:) "Value" => "0.00", "Receiving Organisation Name" => nil, "Receiving Organisation Type" => nil, - "Receiving Organisation IATI Reference" => nil, - }, + "Receiving Organisation IATI Reference" => nil + } ]) end diff --git a/spec/features/staff/users_can_upload_forecasts_spec.rb b/spec/features/staff/users_can_upload_forecasts_spec.rb index 7a764fb22..683b2fc52 100644 --- a/spec/features/staff/users_can_upload_forecasts_spec.rb +++ b/spec/features/staff/users_can_upload_forecasts_spec.rb @@ -47,13 +47,13 @@ def expect_to_see_successful_upload_summary_with(count:, total:) { "Activity Name" => project.title, "Activity Delivery Partner Identifier" => project.delivery_partner_identifier, - "Activity RODA Identifier" => project.roda_identifier, + "Activity RODA Identifier" => project.roda_identifier }, { "Activity Name" => sibling_project.title, "Activity Delivery Partner Identifier" => sibling_project.delivery_partner_identifier, - "Activity RODA Identifier" => sibling_project.roda_identifier, - }, + "Activity RODA Identifier" => sibling_project.roda_identifier + } ]) end @@ -66,7 +66,7 @@ def expect_to_see_successful_upload_summary_with(count:, total:) "FC 2022/23 FY Q2", "FC 2022/23 FY Q3", "FC 2022/23 FY Q4", "FC 2023/24 FY Q1", "FC 2023/24 FY Q2", "FC 2023/24 FY Q3", "FC 2023/24 FY Q4", "FC 2024/25 FY Q1", "FC 2024/25 FY Q2", "FC 2024/25 FY Q3", "FC 2024/25 FY Q4", "FC 2025/26 FY Q1", - "FC 2025/26 FY Q2", "FC 2025/26 FY Q3", "FC 2025/26 FY Q4", "FC 2026/27 FY Q1", + "FC 2025/26 FY Q2", "FC 2025/26 FY Q3", "FC 2025/26 FY Q4", "FC 2026/27 FY Q1" ]) end diff --git a/spec/features/staff/users_can_view_activities_spec.rb b/spec/features/staff/users_can_view_activities_spec.rb index dec4644fc..455347e8e 100644 --- a/spec/features/staff/users_can_view_activities_spec.rb +++ b/spec/features/staff/users_can_view_activities_spec.rb @@ -75,7 +75,7 @@ context "when the user is signed in as a BEIS user" do include_examples "shows activities", { - user_type: :beis_user, + user_type: :beis_user } scenario "cannot add a child activity to a programme (level C) activity" do delivery_partner_organisation = create(:delivery_partner_organisation) @@ -93,7 +93,7 @@ context "when the user is signed in as a delivery partner" do context "when viewing the activities index page" do include_examples "shows activities", { - user_type: :delivery_partner_user, + user_type: :delivery_partner_user } end end diff --git a/spec/features/staff/users_can_view_actuals_within_report_spec.rb b/spec/features/staff/users_can_view_actuals_within_report_spec.rb index 7643b4d36..568d0f1ff 100644 --- a/spec/features/staff/users_can_view_actuals_within_report_spec.rb +++ b/spec/features/staff/users_can_view_actuals_within_report_spec.rb @@ -85,7 +85,7 @@ def expect_to_see_total_of_refund_amounts(activities) parent: project).tap do |activity| create_list(:actual, 3, report: report, parent_activity: activity) create_list(:refund, 4, report: report, parent_activity: activity) - end, + end ] visit report_path(report.id) diff --git a/spec/features/staff/users_can_view_an_activitys_change_history_spec.rb b/spec/features/staff/users_can_view_an_activitys_change_history_spec.rb index d06579205..ee9913c86 100644 --- a/spec/features/staff/users_can_view_an_activitys_change_history_spec.rb +++ b/spec/features/staff/users_can_view_an_activitys_change_history_spec.rb @@ -10,14 +10,14 @@ organisation: programme.organisation, fund: programme.parent, financial_quarter: 3, - financial_year: 2020, + financial_year: 2020 ) end let(:reference) { "Update to Activity purpose" } let(:changes) do {"title" => ["Original title", "Updated title"], - "description" => ["Original description", "Updated description"],} + "description" => ["Original description", "Updated description"]} end before do diff --git a/spec/features/staff/users_can_view_forecasts_within_report_spec.rb b/spec/features/staff/users_can_view_forecasts_within_report_spec.rb index 061b30cfa..2d681fa27 100644 --- a/spec/features/staff/users_can_view_forecasts_within_report_spec.rb +++ b/spec/features/staff/users_can_view_forecasts_within_report_spec.rb @@ -57,7 +57,7 @@ def expect_to_see_total_of_forecasted_amounts(activities) organisation: organisation, fund: programme.parent, financial_quarter: 3, - financial_year: 2020, + financial_year: 2020 ) activities = 2.times.map { diff --git a/spec/features/staff/users_can_view_project_level_activities_spec.rb b/spec/features/staff/users_can_view_project_level_activities_spec.rb index e65341e08..f68724f62 100644 --- a/spec/features/staff/users_can_view_project_level_activities_spec.rb +++ b/spec/features/staff/users_can_view_project_level_activities_spec.rb @@ -81,7 +81,7 @@ header = page.response_headers["Content-Disposition"] expect(header).to match(/^attachment/) - expect(header).to match(/filename=\"#{project.transparency_identifier}.xml\"$/) + expect(header).to match(/filename="#{project.transparency_identifier}.xml"$/) end end end diff --git a/spec/features/staff/users_can_view_reports_spec.rb b/spec/features/staff/users_can_view_reports_spec.rb index f4d75f994..adb2823e6 100644 --- a/spec/features/staff/users_can_view_reports_spec.rb +++ b/spec/features/staff/users_can_view_reports_spec.rb @@ -39,12 +39,12 @@ def expect_to_see_grouped_rows_of_reports_for_an_organisation(organisation:, exp create_list(:report, 2, :active, organisation: organisations.first), create_list(:report, 3, :active, organisation: organisations.last), create_list(:report, 3, :awaiting_changes, organisation: organisations.first), - create_list(:report, 2, :in_review, organisation: organisations.last), + create_list(:report, 2, :in_review, organisation: organisations.last) ].flatten approved_reports = [ create_list(:report, 3, :approved, organisation: organisations.first), - create_list(:report, 1, :approved, organisation: organisations.last), + create_list(:report, 1, :approved, organisation: organisations.last) ].flatten visit reports_path @@ -226,7 +226,7 @@ def expect_to_see_grouped_rows_of_reports_for_an_organisation(organisation:, exp comments_for_report = [ create_list(:comment, 3, commentable: activities[0], report: report), - create_list(:comment, 1, commentable: activities[1], report: report), + create_list(:comment, 1, commentable: activities[1], report: report) ].flatten page = ReportPage.new(report) @@ -417,12 +417,12 @@ def expect_to_see_a_table_of_reports(selector:, reports:) activity_comments = [ create_list(:comment, 3, commentable: activities[0], report: report, owner: delivery_partner_user), - create_list(:comment, 1, commentable: activities[1], report: report, owner: delivery_partner_user), + create_list(:comment, 1, commentable: activities[1], report: report, owner: delivery_partner_user) ].flatten refund_comments = [ create_list(:comment, 2, commentable: create(:refund, parent_activity: activities[0]), report: report), - create_list(:comment, 1, commentable: create(:refund, parent_activity: activities[1]), report: report), + create_list(:comment, 1, commentable: create(:refund, parent_activity: activities[1]), report: report) ].flatten adjustment_comments = create_list(:comment, 2, commentable: create(:adjustment, parent_activity: activities[0]), report: report) diff --git a/spec/helpers/form_helper_spec.rb b/spec/helpers/form_helper_spec.rb index bf03e554f..7d523cd89 100644 --- a/spec/helpers/form_helper_spec.rb +++ b/spec/helpers/form_helper_spec.rb @@ -19,7 +19,7 @@ expect(helper.list_of_delivery_partners).to match_array([ delivery_partner_1, - delivery_partner_2, + delivery_partner_2 ]) end end @@ -36,7 +36,7 @@ expect(helper.list_of_reporting_organisations).to match_array([ delivery_partner_1, beis, - delivery_partner_2, + delivery_partner_2 ]) end end diff --git a/spec/helpers/user_helper_spec.rb b/spec/helpers/user_helper_spec.rb index 9296a5473..e88e5ab49 100644 --- a/spec/helpers/user_helper_spec.rb +++ b/spec/helpers/user_helper_spec.rb @@ -11,7 +11,7 @@ expect(helper.organisation_check_box_options) .to match([ [first_organisation.name, first_organisation.id], - [second_organisation.name, second_organisation.id], + [second_organisation.name, second_organisation.id] ]) end end diff --git a/spec/lib/roda_form_builder/form_builder_spec.rb b/spec/lib/roda_form_builder/form_builder_spec.rb index cbb2d482e..274517ac2 100644 --- a/spec/lib/roda_form_builder/form_builder_spec.rb +++ b/spec/lib/roda_form_builder/form_builder_spec.rb @@ -19,7 +19,7 @@ class TestHelper < ActionView::Base; end :govuk_password_field, :govuk_url_field, :govuk_number_field, - :govuk_text_area, + :govuk_text_area ].each do |field| describe "##{field}" do let(:field_name) { :title } @@ -50,13 +50,13 @@ class TestHelper < ActionView::Base; end [ :govuk_collection_select, :govuk_collection_radio_buttons, - :govuk_collection_check_boxes, + :govuk_collection_check_boxes ].each do |field| let(:field_name) { :title } let(:collection) do [ OpenStruct.new(name: "Foo", code: 1), - OpenStruct.new(name: "Bar", code: 2), + OpenStruct.new(name: "Bar", code: 2) ] end let(:output) do diff --git a/spec/lib/tasks/import_activities_spec.rb b/spec/lib/tasks/import_activities_spec.rb index cca40f8cb..e6ea0e199 100644 --- a/spec/lib/tasks/import_activities_spec.rb +++ b/spec/lib/tasks/import_activities_spec.rb @@ -82,7 +82,7 @@ let(:errors) do [ Activities::ImportFromCsv::Error.new(1, :title, "Foo", "Blah"), - Activities::ImportFromCsv::Error.new(2, :description, "Bar", "Blah"), + Activities::ImportFromCsv::Error.new(2, :description, "Bar", "Blah") ] end diff --git a/spec/lib/tasks/import_commitments_spec.rb b/spec/lib/tasks/import_commitments_spec.rb index 7f8cccfa5..3b37a2786 100644 --- a/spec/lib/tasks/import_commitments_spec.rb +++ b/spec/lib/tasks/import_commitments_spec.rb @@ -56,7 +56,7 @@ it "outputs the specific errors" do errors = [ Import::Commitments::RowError.new("Value must be greater than 0", 1), - Import::Commitments::RowError.new("Value must be greater than 0", 2), + Import::Commitments::RowError.new("Value must be greater than 0", 2) ] importer = double(:importer, errors: errors, imported: []) diff --git a/spec/models/activity_spec.rb b/spec/models/activity_spec.rb index 68a896204..a838bf9d2 100644 --- a/spec/models/activity_spec.rb +++ b/spec/models/activity_spec.rb @@ -127,7 +127,7 @@ expect(activity.comments).to match_array([ activity_comment, refund.comment, - adjustment.comment, + adjustment.comment ]) end end @@ -1408,31 +1408,31 @@ programme1_projects, programme2_projects, programme1_third_party_project, - programme2_third_party_project, + programme2_third_party_project ].flatten) end it "returns all the activities in a programme" do expect(programme1.descendants).to match_array([ programme1_projects, - programme1_third_party_project, + programme1_third_party_project ].flatten) expect(programme2.descendants).to match_array([ programme2_projects, - programme2_third_party_project, + programme2_third_party_project ].flatten) end it "returns all the activities in a project" do expect(programme1_projects[0].descendants).to match_array([ - programme1_third_party_project, + programme1_third_party_project ].flatten) expect(programme1_projects[1].descendants).to eq([]) expect(programme2_projects[0].descendants).to eq([]) expect(programme2_projects[1].descendants).to match_array([ - programme2_third_party_project, + programme2_third_party_project ].flatten) end end @@ -1562,7 +1562,7 @@ def create_report(organisation, fund) [programme2, quarter.succ, 2560], [programme2_projects[0], quarter, 5120], - [programme2_projects[1], quarter, 10240], + [programme2_projects[1], quarter, 10240] ] forecasts.each do |activity, quarter, value| @@ -1649,7 +1649,7 @@ def create_report(organisation, fund) programme2_projects1_actual.id, programme2_projects2_actual.id, programme1_tpp_actual.id, - programme2_tpp_actual.id, + programme2_tpp_actual.id ]) end end diff --git a/spec/models/benefitting_country_spec.rb b/spec/models/benefitting_country_spec.rb index b7dd2f5f7..fa36a5bc6 100644 --- a/spec/models/benefitting_country_spec.rb +++ b/spec/models/benefitting_country_spec.rb @@ -23,9 +23,9 @@ regions: [ africa, south_of_sahara, - eastern_africa, + eastern_africa ] - ), + ) ] end @@ -38,7 +38,7 @@ regions: [ africa, south_of_sahara, - middle_africa, + middle_africa ] ), BenefittingCountry.new( @@ -48,7 +48,7 @@ regions: [ africa, south_of_sahara, - middle_africa, + middle_africa ] ), BenefittingCountry.new( @@ -58,7 +58,7 @@ regions: [ africa, south_of_sahara, - eastern_africa, + eastern_africa ] ), BenefittingCountry.new( @@ -68,7 +68,7 @@ regions: [ africa, south_of_sahara, - eastern_africa, + eastern_africa ] ), BenefittingCountry.new( @@ -77,7 +77,7 @@ graduated: false, regions: [ africa, - north_of_sahara, + north_of_sahara ] ), BenefittingCountry.new( @@ -86,9 +86,9 @@ graduated: false, regions: [ asia, - middle_east, + middle_east ] - ), + ) ] end diff --git a/spec/models/codelist_spec.rb b/spec/models/codelist_spec.rb index fcebb1ffa..5c13ea5a2 100644 --- a/spec/models/codelist_spec.rb +++ b/spec/models/codelist_spec.rb @@ -166,7 +166,7 @@ allow(codelist).to receive(:list) do [ {"foo" => "bar"}, - {"foo" => "baz"}, + {"foo" => "baz"} ] end end @@ -179,7 +179,7 @@ allow(codelist).to receive(:list) do [ {"code" => "A01"}, - {"code" => "B01"}, + {"code" => "B01"} ] end end @@ -192,7 +192,7 @@ allow(codelist).to receive(:list) do [ {"code" => "B01"}, - {"code" => "C01"}, + {"code" => "C01"} ] end end diff --git a/spec/models/comment_spec.rb b/spec/models/comment_spec.rb index af22af4c8..db3db85e5 100644 --- a/spec/models/comment_spec.rb +++ b/spec/models/comment_spec.rb @@ -61,7 +61,7 @@ expect(Comment.for_activity(activity)).to match_array([ activity_comment, refund.comment, - adjustment.comment, + adjustment.comment ]) end end diff --git a/spec/models/concerns/has_financial_quarter_spec.rb b/spec/models/concerns/has_financial_quarter_spec.rb index ea91d9561..3f74e3ff9 100644 --- a/spec/models/concerns/has_financial_quarter_spec.rb +++ b/spec/models/concerns/has_financial_quarter_spec.rb @@ -1,9 +1,11 @@ require "rails_helper" RSpec.describe HasFinancialQuarter do + # standard:disable Lint/ConstantDefinitionInBlock TestReport = Struct.new(:financial_quarter, :financial_year) { include HasFinancialQuarter } + # standard:enable Lint/ConstantDefinitionInBlock describe "#own_financial_quarter" do it "returns the financial quarter and year as an object" do diff --git a/spec/models/csv_file_upload_spec.rb b/spec/models/csv_file_upload_spec.rb index 5dc62d72d..fe30973ed 100644 --- a/spec/models/csv_file_upload_spec.rb +++ b/spec/models/csv_file_upload_spec.rb @@ -10,7 +10,7 @@ let(:file) { double("File") } let(:params) do { - csv: file, + csv: file } end diff --git a/spec/models/export/activity_actuals_columns_spec.rb b/spec/models/export/activity_actuals_columns_spec.rb index f300633d6..e3ce72531 100644 --- a/spec/models/export/activity_actuals_columns_spec.rb +++ b/spec/models/export/activity_actuals_columns_spec.rb @@ -49,7 +49,7 @@ "Actual net FQ1 2020-2021", "Actual net FQ2 2020-2021", "Actual net FQ3 2020-2021", - "Actual net FQ4 2020-2021", + "Actual net FQ4 2020-2021" ] ) end @@ -68,7 +68,7 @@ it "contains the financial data for FQ4 2020-2021" do expect(value_for_header("Actual net FQ4 2020-2021")) - .to eq BigDecimal(300) + .to eq BigDecimal("300") end it "contains zero values for the financial quarters inbetween" do @@ -89,7 +89,7 @@ [ "Actual net FQ1 2020-2021", "Actual net FQ2 2020-2021", - "Actual net FQ3 2020-2021", + "Actual net FQ3 2020-2021" ] ) end @@ -125,7 +125,7 @@ last_column_data = subject.rows_for_last_financial_quarter value_for_activity = last_column_data.fetch(@activity.id) - expect(value_for_activity).to eq BigDecimal(300) + expect(value_for_activity).to eq BigDecimal("300") expect(last_column_data.count).to eq 5 end end @@ -140,7 +140,7 @@ expect(subject.headers).to include( "Actual spend FQ1 2020-2021", "Refund FQ1 2020-2021", - "Actual net FQ1 2020-2021", + "Actual net FQ1 2020-2021" ) end @@ -148,7 +148,7 @@ expect(subject.headers).to include( "Actual spend FQ3 2020-2021", "Refund FQ3 2020-2021", - "Actual net FQ3 2020-2021", + "Actual net FQ3 2020-2021" ) end @@ -156,7 +156,7 @@ expect(subject.headers).to include( "Actual spend FQ4 2020-2021", "Refund FQ4 2020-2021", - "Actual net FQ4 2020-2021", + "Actual net FQ4 2020-2021" ) end @@ -164,7 +164,7 @@ expect(subject.headers).to include( "Actual spend FQ2 2020-2021", "Refund FQ2 2020-2021", - "Actual net FQ2 2020-2021", + "Actual net FQ2 2020-2021" ) end end @@ -195,11 +195,11 @@ it "contains the financial data for FQ4 2020-2021" do aggregate_failures do expect(value_for_header("Actual spend FQ4 2020-2021")) - .to eq BigDecimal(300) + .to eq BigDecimal("300") expect(value_for_header("Refund FQ4 2020-2021")) .to eq 0 expect(value_for_header("Actual net FQ4 2020-2021")) - .to eq BigDecimal(300) + .to eq BigDecimal("300") end end diff --git a/spec/models/export/activity_attributes_columns_spec.rb b/spec/models/export/activity_attributes_columns_spec.rb index a6f5a1880..761b94046 100644 --- a/spec/models/export/activity_attributes_columns_spec.rb +++ b/spec/models/export/activity_attributes_columns_spec.rb @@ -20,7 +20,7 @@ I18n.t("activerecord.attributes.activity.roda_identifier"), I18n.t("activerecord.attributes.activity.delivery_partner_identifier"), I18n.t("activerecord.attributes.activity.programme_status"), - I18n.t("activerecord.attributes.activity.benefitting_region"), + I18n.t("activerecord.attributes.activity.benefitting_region") ] expect(subject.headers).to match_array(headers) end @@ -36,7 +36,7 @@ headers = [ I18n.t("activerecord.attributes.activity.delivery_partner_identifier"), I18n.t("activerecord.attributes.activity.roda_identifier"), - I18n.t("activerecord.attributes.activity.programme_status"), + I18n.t("activerecord.attributes.activity.programme_status") ] expect(subject.headers).to match_array(headers) end @@ -52,14 +52,14 @@ first_row_activity_presenter.roda_identifier, first_row_activity_presenter.delivery_partner_identifier, first_row_activity_presenter.programme_status, - first_row_activity_presenter.benefitting_region, + first_row_activity_presenter.benefitting_region ] last_row_values = [ last_row_activity_presenter.roda_identifier, last_row_activity_presenter.delivery_partner_identifier, last_row_activity_presenter.programme_status, - last_row_activity_presenter.benefitting_region, + last_row_activity_presenter.benefitting_region ] expect(subject.rows.count).to eq 5 @@ -83,7 +83,7 @@ I18n.t("activerecord.attributes.activity.roda_identifier"), I18n.t("activerecord.attributes.activity.delivery_partner_identifier"), I18n.t("activerecord.attributes.activity.programme_status"), - I18n.t("activerecord.attributes.activity.benefitting_region"), + I18n.t("activerecord.attributes.activity.benefitting_region") ] expect(subject.headers).to match_array(headers) end diff --git a/spec/models/export/activity_attributes_order_spec.rb b/spec/models/export/activity_attributes_order_spec.rb index efb62ecb0..cb99d880a 100644 --- a/spec/models/export/activity_attributes_order_spec.rb +++ b/spec/models/export/activity_attributes_order_spec.rb @@ -51,7 +51,7 @@ :gcrf_challenge_area, :fund_pillar, :country_delivery_partners, - :uk_dp_named_contact, + :uk_dp_named_contact ] end end diff --git a/spec/models/export/activity_forecast_columns_spec.rb b/spec/models/export/activity_forecast_columns_spec.rb index 132b0479f..970c689d5 100644 --- a/spec/models/export/activity_forecast_columns_spec.rb +++ b/spec/models/export/activity_forecast_columns_spec.rb @@ -101,20 +101,20 @@ it "includes the heading that describe the finances for financial quarter FQ1 2021-2022" do expect(subject.headers).to include( - "Forecast FQ1 2021-2022", + "Forecast FQ1 2021-2022" ) end it "includes the heading that describe the finances for financial quarter FQ4 2021-2022" do expect(subject.headers).to include( - "Forecast FQ4 2021-2022", + "Forecast FQ4 2021-2022" ) end it "includes the headings that describe the finances for financial quarters inbetween" do expect(subject.headers).to include( "Forecast FQ2 2021-2022", - "Forecast FQ3 2021-2022", + "Forecast FQ3 2021-2022" ) end end @@ -163,20 +163,20 @@ it "includes the heading that describe the finances for financial quarter FQ1 2021-2022" do expect(subject.headers).to include( - "Forecast FQ1 2021-2022", + "Forecast FQ1 2021-2022" ) end it "includes the heading that describe the finances for financial quarter FQ4 2021-2022" do expect(subject.headers).to include( - "Forecast FQ4 2021-2022", + "Forecast FQ4 2021-2022" ) end it "includes the headings that describe the finances for financial quarters inbetween" do expect(subject.headers).to include( "Forecast FQ2 2021-2022", - "Forecast FQ3 2021-2022", + "Forecast FQ3 2021-2022" ) end @@ -225,7 +225,7 @@ first_column_of_forecasts = subject.rows_for_first_financial_quarter activity_value = first_column_of_forecasts.fetch(@activity.id) - expect(activity_value).to eq BigDecimal(10_000) + expect(activity_value).to eq BigDecimal("10_000") expect(first_column_of_forecasts.count).to eq 5 end diff --git a/spec/models/export/activity_implementing_organisation_column_spec.rb b/spec/models/export/activity_implementing_organisation_column_spec.rb index 040b21106..bf60b0ebe 100644 --- a/spec/models/export/activity_implementing_organisation_column_spec.rb +++ b/spec/models/export/activity_implementing_organisation_column_spec.rb @@ -99,7 +99,6 @@ def activity_with_multiple_organisations def level_b_activity_with_extending_organisation organisation = create(:delivery_partner_organisation) - activity = create(:programme_activity, extending_organisation: organisation) - activity + create(:programme_activity, extending_organisation: organisation) end end diff --git a/spec/models/export/all_activity_totals_spec.rb b/spec/models/export/all_activity_totals_spec.rb index 6fcb8b76e..a9c6e871f 100644 --- a/spec/models/export/all_activity_totals_spec.rb +++ b/spec/models/export/all_activity_totals_spec.rb @@ -40,10 +40,10 @@ it "returns all totals for Q1 including those added in a later report" do all_q1_totals = { - [@activity.id, 1, 2020, "Actual", nil] => BigDecimal(100), + [@activity.id, 1, 2020, "Actual", nil] => BigDecimal("100"), [@activity.id, 1, 2020, "Adjustment", "Actual"] => BigDecimal(200 - 100 + 500), [@activity.id, 1, 2020, "Adjustment", "Refund"] => BigDecimal(50 - 200 + 400), - [@activity.id, 1, 2020, "Refund", nil] => BigDecimal(-200), + [@activity.id, 1, 2020, "Refund", nil] => BigDecimal("-200") } expect(subject.call).to include all_q1_totals @@ -51,10 +51,10 @@ it "returns all totals for Q3 including those added in a later report" do all_q3_totals = { - [@activity.id, 3, 2020, "Actual", nil] => BigDecimal(125), + [@activity.id, 3, 2020, "Actual", nil] => BigDecimal("125"), [@activity.id, 3, 2020, "Adjustment", "Actual"] => BigDecimal(200 + -100), [@activity.id, 3, 2020, "Adjustment", "Refund"] => BigDecimal(100 + -200), - [@activity.id, 3, 2020, "Refund", nil] => BigDecimal(-200), + [@activity.id, 3, 2020, "Refund", nil] => BigDecimal("-200") } expect(subject.call).to include all_q3_totals @@ -66,11 +66,11 @@ it "returns the totals up to and including Q3" do all_totals_at_q3 = { - [@activity.id, 1, 2020, "Actual", nil] => BigDecimal(100), + [@activity.id, 1, 2020, "Actual", nil] => BigDecimal("100"), [@activity.id, 1, 2020, "Adjustment", "Actual"] => BigDecimal(200 + -100), [@activity.id, 1, 2020, "Adjustment", "Refund"] => BigDecimal(50 + -200), - [@activity.id, 1, 2020, "Refund", nil] => BigDecimal(-200), - [@activity.id, 3, 2020, "Actual", nil] => BigDecimal(125), + [@activity.id, 1, 2020, "Refund", nil] => BigDecimal("-200"), + [@activity.id, 3, 2020, "Actual", nil] => BigDecimal("125") } expect(subject.call).to eq all_totals_at_q3 end @@ -80,14 +80,14 @@ [@activity.id, 4, 2020, "Actual", nil] => anything, [@activity.id, 4, 2020, "Adjustment", "Actual"] => anything, [@activity.id, 4, 2020, "Adjustment", "Refund"] => anything, - [@activity.id, 4, 2020, "Refund", nil] => anything, + [@activity.id, 4, 2020, "Refund", nil] => anything } expect(subject.call).not_to include later_totals end it "does not include adjustments added after the Q3 report" do - expect(subject.call).not_to include [@activity.id, 1, 2020, "Adjustment", "Refund"] => BigDecimal(400) - expect(subject.call).not_to include [@activity.id, 1, 2020, "Adjustment", "Actual"] => BigDecimal(500) + expect(subject.call).not_to include [@activity.id, 1, 2020, "Adjustment", "Refund"] => BigDecimal("400") + expect(subject.call).not_to include [@activity.id, 1, 2020, "Adjustment", "Actual"] => BigDecimal("500") end end end diff --git a/spec/models/export/financial_quarter_activity_totals_spec.rb b/spec/models/export/financial_quarter_activity_totals_spec.rb index 580a84dfe..36c4edfe2 100644 --- a/spec/models/export/financial_quarter_activity_totals_spec.rb +++ b/spec/models/export/financial_quarter_activity_totals_spec.rb @@ -4,7 +4,7 @@ [activity.id, 1, 2020, "Refund", nil] => 200, [activity.id, 1, 2020, "Actual", nil] => 300, [activity.id, 1, 2020, "Adjustment", "Actual"] => -100, - [activity.id, 1, 2020, "Adjustment", "Refund"] => -50, + [activity.id, 1, 2020, "Adjustment", "Refund"] => -50 } } diff --git a/spec/models/financial_quarter_spec.rb b/spec/models/financial_quarter_spec.rb index 14c5f2bb9..d4469e40c 100644 --- a/spec/models/financial_quarter_spec.rb +++ b/spec/models/financial_quarter_spec.rb @@ -70,7 +70,7 @@ FinancialQuarter.new(2016, 2), FinancialQuarter.new(2016, 3), FinancialQuarter.new(2016, 4), - FinancialQuarter.new(2017, 1), + FinancialQuarter.new(2017, 1) ]) end end @@ -85,7 +85,7 @@ FinancialQuarter.new(2018, 2), FinancialQuarter.new(2018, 3), FinancialQuarter.new(2018, 4), - FinancialQuarter.new(2019, 1), + FinancialQuarter.new(2019, 1) ]) end end diff --git a/spec/models/financial_year_spec.rb b/spec/models/financial_year_spec.rb index 1bcae2827..4e5cadb04 100644 --- a/spec/models/financial_year_spec.rb +++ b/spec/models/financial_year_spec.rb @@ -66,7 +66,7 @@ FinancialYear.new(2017), FinancialYear.new(2018), FinancialYear.new(2019), - FinancialYear.new(2020), + FinancialYear.new(2020) ]) end diff --git a/spec/models/iati/xml_download_spec.rb b/spec/models/iati/xml_download_spec.rb index b2679b09d..218de8045 100644 --- a/spec/models/iati/xml_download_spec.rb +++ b/spec/models/iati/xml_download_spec.rb @@ -58,17 +58,17 @@ before do allow(project_relation).to receive(:where).with( source_fund_code: Fund.by_short_name("NF").id, - extending_organisation: organisation, + extending_organisation: organisation ).and_return(build_list(:project_activity, 5)) allow(project_relation).to receive(:where).with( source_fund_code: Fund.by_short_name("GCRF").id, - extending_organisation: organisation, + extending_organisation: organisation ).and_return(build_list(:project_activity, 5)) allow(third_party_project_relation).to receive(:where).with( source_fund_code: Fund.by_short_name("GCRF").id, - extending_organisation: organisation, + extending_organisation: organisation ).and_return(build_list(:project_activity, 5)) end diff --git a/spec/models/import/actual_history_spec.rb b/spec/models/import/actual_history_spec.rb index 148f03fd4..93838b2bc 100644 --- a/spec/models/import/actual_history_spec.rb +++ b/spec/models/import/actual_history_spec.rb @@ -179,7 +179,7 @@ it "has the correct value" do subject.call - expect(subject.actual.value).to eq BigDecimal(10_000) + expect(subject.actual.value).to eq BigDecimal("10_000") end it "has the correct report" do @@ -279,7 +279,7 @@ @activity.roda_identifier, current_financial_quarter.quarter.to_s, current_financial_quarter.financial_year.start_year.to_s, - "100000", + "100000" ] ) } diff --git a/spec/models/matched_effort_spec.rb b/spec/models/matched_effort_spec.rb index c276909c6..32266a24f 100644 --- a/spec/models/matched_effort_spec.rb +++ b/spec/models/matched_effort_spec.rb @@ -47,7 +47,7 @@ "training", "access_to_data", "use_of_facilities", - "unspecified", + "unspecified" ].each do |category| context "and the category is `#{category}`" do let(:category) { category } @@ -71,7 +71,7 @@ [ "fellowship", - "other", + "other" ].each do |category| context "and the category is `#{category}`" do let(:category) { category } diff --git a/spec/models/report_spec.rb b/spec/models/report_spec.rb index 71cbd9664..7879f1958 100644 --- a/spec/models/report_spec.rb +++ b/spec/models/report_spec.rb @@ -219,7 +219,7 @@ [ double("forecast", value: 50_000), double("forecast", value: 25_000), - double("forecast", value: 25_000), + double("forecast", value: 25_000) ] } end @@ -250,7 +250,7 @@ expect(report.activities_updated).to match_array([ project_updated_in_report, other_project_updated_in_report, - third_party_project_updated_in_report, + third_party_project_updated_in_report ]) end diff --git a/spec/presenters/activity_csv_presenter_spec.rb b/spec/presenters/activity_csv_presenter_spec.rb index a5138914c..9ac5a5edc 100644 --- a/spec/presenters/activity_csv_presenter_spec.rb +++ b/spec/presenters/activity_csv_presenter_spec.rb @@ -64,8 +64,8 @@ context "when there are more than one country delivery partners" do it "returns them separated by pipes" do activity = build(:programme_activity, country_delivery_partners: ["National Council for the State Funding Agencies (CONFAP)", - "Chinese Academy of Sciences", - "National Research Foundation",]) + "Chinese Academy of Sciences", + "National Research Foundation"]) result = described_class.new(activity).country_delivery_partners expect(result).to eql("National Council for the State Funding Agencies (CONFAP)|Chinese Academy of Sciences|National Research Foundation") end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index ca37b6686..488e06607 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -26,7 +26,7 @@ # directory. Alternatively, in the individual `*_spec.rb` files, manually # require only the support files necessary. # -Dir[Rails.root.join("spec", "support", "**", "*.rb")].each { |f| require f } +Dir[Rails.root.join("spec", "support", "**", "*.rb")].sort.each { |f| require f } # Checks for pending migrations and applies them before tests are run. # If you are not using ActiveRecord, you can remove these lines. diff --git a/spec/requests/activity_forms_spec.rb b/spec/requests/activity_forms_spec.rb index fb8ba0421..a91516237 100644 --- a/spec/requests/activity_forms_spec.rb +++ b/spec/requests/activity_forms_spec.rb @@ -69,7 +69,7 @@ "planned_start_date(1i)": "2020", "planned_end_date(3i)": "01", "planned_end_date(2i)": "15", - "planned_end_date(1i)": "2021", + "planned_end_date(1i)": "2021" }) expect(response).to_not redirect_to_next_step diff --git a/spec/requests/health_check_spec.rb b/spec/requests/health_check_spec.rb index de4943555..fa055390f 100644 --- a/spec/requests/health_check_spec.rb +++ b/spec/requests/health_check_spec.rb @@ -12,7 +12,7 @@ "built_at" => "2020-01-01T00:00:00Z", "sidekiq" => { "enqueued" => 0, - "retry_size" => 0, + "retry_size" => 0 } ) end diff --git a/spec/services/activities/import_from_csv_spec.rb b/spec/services/activities/import_from_csv_spec.rb index f6caa155b..4cb13e95f 100644 --- a/spec/services/activities/import_from_csv_spec.rb +++ b/spec/services/activities/import_from_csv_spec.rb @@ -63,7 +63,7 @@ "BEIS ID" => "BEIS_ID_EXAMPLE_01", "UK DP Named Contact" => "Jo Soap", "NF Partner Country DP" => "Association of Example Companies (AEC) | | Board of Sample Organisations (BSO)", - "Implementing organisation name" => "Impl. Org 1", + "Implementing organisation name" => "Impl. Org 1" } end let(:new_activity_attributes) do @@ -71,7 +71,7 @@ "RODA ID" => "", "Parent RODA ID" => parent_activity.roda_identifier, "Transparency identifier" => "23232332323", - "Implementing organisation name" => "Impl. Org 2", + "Implementing organisation name" => "Impl. Org 2" }) end @@ -202,7 +202,7 @@ invalid_activity_attributes = existing_activity_attributes.merge({"RODA ID" => "FAKE RODA ID"}) activities = [ existing_activity_attributes, - invalid_activity_attributes, + invalid_activity_attributes ] expect { subject.import(activities) }.to_not change { existing_activity } @@ -291,7 +291,7 @@ expect(subject.errors.map(&:message)).to match_array([ "Select a category", - "is not a known implementing organisation", + "is not a known implementing organisation" ]) end end @@ -693,7 +693,7 @@ "Planned start date" => :planned_start_date, "Planned end date" => :planned_end_date, "Actual start date" => :actual_start_date, - "Actual end date" => :actual_end_date, + "Actual end date" => :actual_end_date }.each do |attr_name, column_name| it "has an error if any the #{attr_name} is invalid" do new_activity_attributes[attr_name] = "12/31/2020" @@ -806,7 +806,7 @@ let(:expected_changes) do { "attr_1" => ["old attr_1 value", "new attr_1 value"], - "attr_2" => ["old attr_2 value", "new attr_2 value"], + "attr_2" => ["old attr_2 value", "new attr_2 value"] } end diff --git a/spec/services/activity/grouped_actitvities_fetcher_spec.rb b/spec/services/activity/grouped_actitvities_fetcher_spec.rb index a468d4534..5ea11927e 100644 --- a/spec/services/activity/grouped_actitvities_fetcher_spec.rb +++ b/spec/services/activity/grouped_actitvities_fetcher_spec.rb @@ -18,10 +18,10 @@ fund => { programme => { project => [ - third_party_project, - ], - }, - }, + third_party_project + ] + } + } }) end @@ -44,18 +44,18 @@ fund => { programme => { project => [ - third_party_project, - ], - }, - }, + third_party_project + ] + } + } }) expect(historic_activities).to eq({ fund => { non_current_programme => { - non_current_project_1 => [], - }, - }, + non_current_project_1 => [] + } + } }) end end @@ -78,10 +78,10 @@ fund => { programme => { project => [ - third_party_project, - ], - }, - }, + third_party_project + ] + } + } }) end end @@ -107,16 +107,16 @@ fund => { old_programme => { old_project_1 => [], - new_project_1 => [], + new_project_1 => [] }, new_programme => { old_project_2 => [ old_third_party_project, - new_third_party_project, + new_third_party_project ], - new_project_2 => [], - }, - }, + new_project_2 => [] + } + } }) end end diff --git a/spec/services/activity/historical_events_grouper_spec.rb b/spec/services/activity/historical_events_grouper_spec.rb index b803bd773..18ae94281 100644 --- a/spec/services/activity/historical_events_grouper_spec.rb +++ b/spec/services/activity/historical_events_grouper_spec.rb @@ -49,14 +49,14 @@ { reference: "Import from CSV", user: "fred@example.com", - timestamp: "07 Jul 2021 at 10:45", + timestamp: "07 Jul 2021 at 10:45" } => [event4, event3], { reference: "Update to Activity programme_status", user: "john@example.com", - timestamp: "02 Jul 2021 at 12:08", - } => [event2, event1], + timestamp: "02 Jul 2021 at 12:08" + } => [event2, event1] } ) end diff --git a/spec/services/activity/roda_identifier_generator_spec.rb b/spec/services/activity/roda_identifier_generator_spec.rb index ef9f4fac7..b162f3a43 100644 --- a/spec/services/activity/roda_identifier_generator_spec.rb +++ b/spec/services/activity/roda_identifier_generator_spec.rb @@ -7,7 +7,7 @@ subject do described_class.new( parent_activity: parent_activity, - extending_organisation: extending_organisation, + extending_organisation: extending_organisation ).generate end diff --git a/spec/services/activity_defaults_spec.rb b/spec/services/activity_defaults_spec.rb index ad35f6fa0..ba23afee6 100644 --- a/spec/services/activity_defaults_spec.rb +++ b/spec/services/activity_defaults_spec.rb @@ -112,7 +112,7 @@ expect([ identifier_parts.first, identifier_parts.second, - identifier_parts.third, + identifier_parts.third ].join("-")).to eq(programme.roda_identifier) expect(identifier_parts.third).to match(/[23456789ABCDEFGHJKLMNPQRSTUVWXYZ]{7}/) end @@ -161,7 +161,7 @@ identifier_parts.first, identifier_parts.second, identifier_parts.third, - identifier_parts.fourth, + identifier_parts.fourth ].join("-")).to eq(project.roda_identifier) expect(identifier_parts.fourth).to match(/[23456789ABCDEFGHJKLMNPQRSTUVWXYZ]{7}/) end diff --git a/spec/services/actual/export_spec.rb b/spec/services/actual/export_spec.rb index e8b1ef6ce..b7e0f9210 100644 --- a/spec/services/actual/export_spec.rb +++ b/spec/services/actual/export_spec.rb @@ -17,7 +17,7 @@ expect(quarter_headers).to eq [] expect(actual_data).to eq([ - [project.roda_identifier], + [project.roda_identifier] ]) end @@ -30,7 +30,7 @@ expect(quarter_headers).to eq ["FQ1 2014-2015"] expect(actual_data).to eq([ - [project.roda_identifier, "30.00"], + [project.roda_identifier, "30.00"] ]) end @@ -43,7 +43,7 @@ expect(quarter_headers).to eq ["FQ1 2014-2015", "FQ2 2014-2015", "FQ3 2014-2015", "FQ4 2014-2015"] expect(actual_data).to eq([ - [project.roda_identifier, "10.00", "0.00", "0.00", "20.00"], + [project.roda_identifier, "10.00", "0.00", "0.00", "20.00"] ]) end @@ -58,7 +58,7 @@ expect(actual_data).to match_array([ [project.roda_identifier, "10.00", "0.00", "0.00", "0.00", "0.00", "0.00"], - [third_party_project.roda_identifier, "0.00", "0.00", "0.00", "0.00", "0.00", "20.00"], + [third_party_project.roda_identifier, "0.00", "0.00", "0.00", "0.00", "0.00", "20.00"] ]) end @@ -72,7 +72,7 @@ expect(actual_data).to match_array([ [project.roda_identifier, "10.00"], - [third_party_project.roda_identifier, "0.00"], + [third_party_project.roda_identifier, "0.00"] ]) end end diff --git a/spec/services/actual/overview_spec.rb b/spec/services/actual/overview_spec.rb index be68b032a..c17753729 100644 --- a/spec/services/actual/overview_spec.rb +++ b/spec/services/actual/overview_spec.rb @@ -61,7 +61,7 @@ [1, 2018, 40], [2, 2018, 0], [3, 2018, 80], - [4, 2018, 160], + [4, 2018, 160] ] } @@ -78,7 +78,7 @@ [1, 2018, 40], [2, 2018, 0], [3, 2018, 80], - [4, 2018, 160], + [4, 2018, 160] ] } @@ -98,7 +98,7 @@ [1, 2018, 40], [2, 2018, 1_280], [3, 2018, 2_640], - [4, 2018, 160], + [4, 2018, 160] ] } @@ -115,7 +115,7 @@ [1, 2018, 40], [2, 2018, 1_280], [3, 2018, 2_640], - [4, 2018, 160], + [4, 2018, 160] ] } @@ -135,7 +135,7 @@ [1, 2018, 10_280], [2, 2018, 21_760], [3, 2018, 43_600], - [4, 2018, 82_080], + [4, 2018, 82_080] ] } @@ -152,7 +152,7 @@ [1, 2018, 10_280], [2, 2018, 21_760], [3, 2018, 43_600], - [4, 2018, 82_080], + [4, 2018, 82_080] ] } diff --git a/spec/services/budget/export_spec.rb b/spec/services/budget/export_spec.rb index 0e95074bf..e3f84e90c 100644 --- a/spec/services/budget/export_spec.rb +++ b/spec/services/budget/export_spec.rb @@ -8,7 +8,7 @@ build(:budget, financial_year: 2018, value: 100), build(:budget, financial_year: 2019, value: 80), build(:budget, financial_year: 2020, value: 75), - build(:budget, financial_year: 2021, value: 20), + build(:budget, financial_year: 2021, value: 20) ] end @@ -40,7 +40,7 @@ "2018-2019", "2019-2020", "2020-2021", - "2021-2022", + "2021-2022" ]) end @@ -71,7 +71,7 @@ build(:budget, financial_year: 2018, value: 100), build(:budget, financial_year: 2018, value: -20), build(:budget, financial_year: 2019, value: 80), - build(:budget, financial_year: 2021, value: 20), + build(:budget, financial_year: 2021, value: 20) ] end @@ -81,7 +81,7 @@ build(:budget, financial_year: 2019, value: 80), build(:budget, financial_year: 2020, value: 75), build(:budget, financial_year: 2020, value: 25), - build(:budget, financial_year: 2021, value: 20), + build(:budget, financial_year: 2021, value: 20) ] end @@ -96,7 +96,7 @@ "100.00", "80.00", "0.00", - "20.00", + "20.00" ], [ activity1.roda_identifier, @@ -107,7 +107,7 @@ "-20.00", "0.00", "0.00", - "0.00", + "0.00" ], [ activity2.roda_identifier, @@ -118,7 +118,7 @@ "100.00", "80.00", "75.00", - "20.00", + "20.00" ], [ activity2.roda_identifier, @@ -129,8 +129,8 @@ "0.00", "0.00", "25.00", - "0.00", - ], + "0.00" + ] ]) end diff --git a/spec/services/create_adjustment_spec.rb b/spec/services/create_adjustment_spec.rb index d1dda3cfb..8e6785c2f 100644 --- a/spec/services/create_adjustment_spec.rb +++ b/spec/services/create_adjustment_spec.rb @@ -10,7 +10,7 @@ errors: [], build_comment: double, build_detail: double, - parent_activity: activity, + parent_activity: activity ) end @@ -36,7 +36,7 @@ user: user, adjustment_type: "Actual", financial_quarter: 2, - financial_year: 2020,} + financial_year: 2020} end it "uses Report#for_activity to verify that the given report is associated " \ @@ -98,7 +98,7 @@ financial_quarter: [nil, valid_attributes.fetch(:financial_quarter)], financial_year: [nil, valid_attributes.fetch(:financial_year)], comment: [nil, valid_attributes.fetch(:comment)], - adjustment_type: [nil, valid_attributes.fetch(:adjustment_type)], + adjustment_type: [nil, valid_attributes.fetch(:adjustment_type)] } creator.call(attributes: valid_attributes) diff --git a/spec/services/create_refund_spec.rb b/spec/services/create_refund_spec.rb index ae1949ad8..14aa81732 100644 --- a/spec/services/create_refund_spec.rb +++ b/spec/services/create_refund_spec.rb @@ -28,7 +28,7 @@ value: 100.10, financial_quarter: 1, financial_year: 2020, - comment: "Some words", + comment: "Some words" } end @@ -53,7 +53,7 @@ value: [nil, -attributes[:value].to_d.abs], financial_quarter: [nil, attributes[:financial_quarter]], financial_year: [nil, attributes[:financial_year]], - comment: [nil, attributes[:comment]], + comment: [nil, attributes[:comment]] } subject @@ -74,7 +74,7 @@ value: 100.10, financial_quarter: nil, financial_year: nil, - comment: "Some words", + comment: "Some words" } end @@ -100,7 +100,7 @@ value: 100.10, financial_quarter: 1, financial_year: 2020, - comment: "Some words", + comment: "Some words" } end diff --git a/spec/services/create_user_in_auth0_spec.rb b/spec/services/create_user_in_auth0_spec.rb index fd25414a6..64bb442fb 100644 --- a/spec/services/create_user_in_auth0_spec.rb +++ b/spec/services/create_user_in_auth0_spec.rb @@ -30,7 +30,7 @@ "statusCode" => 500, "error" => "Foo", "message" => "Bar", - "errorCode" => "x_error", + "errorCode" => "x_error" }] unexpected_error = Auth0::Unsupported.new(params) diff --git a/spec/services/export/report_spec.rb b/spec/services/export/report_spec.rb index 25f88367c..ce57a682a 100644 --- a/spec/services/export/report_spec.rb +++ b/spec/services/export/report_spec.rb @@ -37,7 +37,7 @@ @project, report: create(:report, financial_quarter: @report.financial_quarter.pred), financial_quarter: @report.financial_quarter, - financial_year: @report.financial_year, + financial_year: @report.financial_year ).set_value(10_000) @comment = create(:comment, commentable: @project, report: @report) diff --git a/spec/services/export/spending_breakdown_spec.rb b/spec/services/export/spending_breakdown_spec.rb index a27613895..9a89fab30 100644 --- a/spec/services/export/spending_breakdown_spec.rb +++ b/spec/services/export/spending_breakdown_spec.rb @@ -96,7 +96,7 @@ def value_for_header(header_name) "Delivery partner identifier", "Activity title", "Activity level", - "Activity status", + "Activity status" ) end @@ -108,7 +108,7 @@ def value_for_header(header_name) expect(subject.headers).to include( "Actual spend FQ1 2020-2021", "Refund FQ1 2020-2021", - "Actual net FQ1 2020-2021", + "Actual net FQ1 2020-2021" ) end @@ -123,20 +123,20 @@ def value_for_header(header_name) it "includes the heading that describe the forecast for FQ1 2021-2022" do expect(subject.headers).to include( - "Forecast FQ1 2021-2022", + "Forecast FQ1 2021-2022" ) end it "includes the heading that describe the forecast for FQ4 2021-2022" do expect(subject.headers).to include( - "Forecast FQ4 2021-2022", + "Forecast FQ4 2021-2022" ) end it "includes the headings that describe the finances for the future financial quarters inbetween" do expect(subject.headers).to include( "Forecast FQ2 2021-2022", - "Forecast FQ3 2021-2022", + "Forecast FQ3 2021-2022" ) end end @@ -165,11 +165,11 @@ def value_for_header(header_name) end it "contains the latest version of the forecast for FQ1 2021-2022" do - expect(value_for_header("Forecast FQ1 2021-2022")).to eq BigDecimal(20_000) + expect(value_for_header("Forecast FQ1 2021-2022")).to eq BigDecimal("20_000") end it "contains the latest versions of the forecast for 2021-2022" do - expect(value_for_header("Forecast FQ4 2021-2022")).to eq BigDecimal(10_000) + expect(value_for_header("Forecast FQ4 2021-2022")).to eq BigDecimal("10_000") end it "contains a zero for the financial quarters inbetween in which there are no forecasts" do @@ -232,7 +232,7 @@ def value_for_header(header_name) "Delivery partner identifier", "Activity title", "Activity level", - "Activity status", + "Activity status" ] expect(subject.headers).to match_array(activity_attribute_headers) expect(subject.rows).to eq [] @@ -247,7 +247,7 @@ def value_for_header(header_name) subject { described_class.new( source_fund: @activities.first.source_fund_code, - organisation: @organisation, + organisation: @organisation ) } end @@ -259,7 +259,7 @@ def value_for_header(header_name) "Activity title", "Activity level", "Activity status", - "Delivery partner organisation", + "Delivery partner organisation" ] expect(subject.headers).to match_array(activity_attribute_headers) expect(subject.rows.count).to eq 3 diff --git a/spec/services/external_income/export_spec.rb b/spec/services/external_income/export_spec.rb index 1b64d0b56..61011d990 100644 --- a/spec/services/external_income/export_spec.rb +++ b/spec/services/external_income/export_spec.rb @@ -12,14 +12,14 @@ let(:external_income) do [ build(:external_income, activity: project, financial_year: 2014, financial_quarter: 1, amount: 10, organisation: delivery_partner), - build(:external_income, activity: project, financial_year: 2014, financial_quarter: 1, amount: 20, organisation: delivery_partner), + build(:external_income, activity: project, financial_year: 2014, financial_quarter: 1, amount: 20, organisation: delivery_partner) ] end # This is where we stub the variables that get returned by `external_incomes` and `activity_ids` before do allow(Activity).to receive(:where).with(organisation_id: delivery_partner.id, source_fund_code: source_fund.id).and_return([ - project, + project ]) allow(ExternalIncome).to receive(:includes).with(activity: :organisation).and_return(external_income_relation) @@ -58,7 +58,7 @@ "Project (level C)", delivery_partner.name, "Yes", - "10.00", + "10.00" ]) expect(external_income_data[1]).to eq([project.roda_identifier, "20.00"]) end @@ -67,7 +67,7 @@ let(:external_income) do [ build(:external_income, activity: project, financial_year: 2014, financial_quarter: 1, amount: 10), - build(:external_income, activity: project, financial_year: 2014, financial_quarter: 4, amount: 20), + build(:external_income, activity: project, financial_year: 2014, financial_quarter: 4, amount: 20) ] end @@ -76,7 +76,7 @@ expect(external_income_data).to eq([ [project.roda_identifier, "10.00", "0.00", "0.00", "0.00"], - [project.roda_identifier, "0.00", "0.00", "0.00", "20.00"], + [project.roda_identifier, "0.00", "0.00", "0.00", "20.00"] ]) end end @@ -86,7 +86,7 @@ it "fetches the external income for all delivery partners" do expect(Activity).to receive(:where).with(source_fund_code: source_fund.id).and_return([ - project, + project ]) export.rows diff --git a/spec/services/forecast_history_spec.rb b/spec/services/forecast_history_spec.rb index 8c7cf676d..47101fe4b 100644 --- a/spec/services/forecast_history_spec.rb +++ b/spec/services/forecast_history_spec.rb @@ -10,7 +10,7 @@ def history_entries entry.forecast_type, entry.report&.financial_quarter, entry.report&.financial_year, - entry.value, + entry.value ] end end @@ -27,7 +27,7 @@ def history_entries history.set_value(10) expect(history_entries).to eq([ - ["original", nil, nil, 10], + ["original", nil, nil, 10] ]) end @@ -39,7 +39,7 @@ def history_entries history.set_value(-10) expect(history_entries).to eq([ - ["original", nil, nil, -10], + ["original", nil, nil, -10] ]) end @@ -54,7 +54,7 @@ def history_entries expect(history_entries).to eq([ ["original", nil, nil, 10], - ["revised", nil, nil, 20], + ["revised", nil, nil, 20] ]) end @@ -70,7 +70,7 @@ def history_entries expect(history_entries).to eq([ ["original", nil, nil, 10], - ["revised", nil, nil, 0], + ["revised", nil, nil, 0] ]) end @@ -80,7 +80,7 @@ def history_entries expect(history_entries).to eq([ ["original", nil, nil, 10], - ["revised", nil, nil, -20], + ["revised", nil, nil, -20] ]) end @@ -91,7 +91,7 @@ def history_entries expect(history_entries).to eq([ ["original", nil, nil, 10], - ["revised", nil, nil, 30], + ["revised", nil, nil, 30] ]) end @@ -102,7 +102,7 @@ def history_entries expect(history_entries).to eq([ ["original", nil, nil, 10], - ["revised", nil, nil, 0], + ["revised", nil, nil, 0] ]) end @@ -113,7 +113,7 @@ def history_entries expect(history_entries).to eq([ ["original", nil, nil, 10], - ["revised", nil, nil, -30], + ["revised", nil, nil, -30] ]) end @@ -122,7 +122,7 @@ def history_entries history.set_value(10) expect(history_entries).to eq([ - ["original", nil, nil, 10], + ["original", nil, nil, 10] ]) end @@ -131,7 +131,7 @@ def history_entries history.set_value(10) expect(history_entries).to eq([ - ["original", nil, nil, 10], + ["original", nil, nil, 10] ]) end @@ -172,7 +172,7 @@ def history_entries history.set_value(10) expect(history_entries).to eq([ - ["original", 1, 2015, 10], + ["original", 1, 2015, 10] ]) end @@ -198,7 +198,7 @@ def history_entries history.set_value(20) expect(history_entries).to eq([ - ["original", 1, 2015, 20], + ["original", 1, 2015, 20] ]) end @@ -224,7 +224,7 @@ def history_entries expect(history_entries).to eq([ ["original", 1, 2015, 10], - ["revised", 2, 2015, 20], + ["revised", 2, 2015, 20] ]) end @@ -233,7 +233,7 @@ def history_entries expect(history_entries).to eq([ ["original", 1, 2015, 10], - ["revised", 2, 2015, 0], + ["revised", 2, 2015, 0] ]) end @@ -242,7 +242,7 @@ def history_entries expect(history_entries).to eq([ ["original", 1, 2015, 10], - ["revised", 2, 2015, 0], + ["revised", 2, 2015, 0] ]) end @@ -252,7 +252,7 @@ def history_entries expect(history_entries).to eq([ ["original", 1, 2015, 10], - ["revised", 2, 2015, 30], + ["revised", 2, 2015, 30] ]) end @@ -262,7 +262,7 @@ def history_entries expect(history_entries).to eq([ ["original", 1, 2015, 10], - ["revised", 2, 2015, 0], + ["revised", 2, 2015, 0] ]) end @@ -272,7 +272,7 @@ def history_entries expect(history_entries).to eq([ ["original", 1, 2015, 10], - ["revised", 2, 2015, 0], + ["revised", 2, 2015, 0] ]) end @@ -285,7 +285,7 @@ def history_entries expect(history_entries).to eq([ ["original", 1, 2015, 10], ["revised", 2, 2015, 20], - ["revised", 1, 2016, 30], + ["revised", 1, 2016, 30] ]) end @@ -311,7 +311,7 @@ def history_entries expect(history_entries).to eq([ ["original", 1, 2015, 10], - ["revised", 3, 2016, 20], + ["revised", 3, 2016, 20] ]) end @@ -341,7 +341,7 @@ def history_entries history.set_value(10) expect(history_entries).to eq([ - ["original", 1, 2015, 10], + ["original", 1, 2015, 10] ]) end @@ -372,7 +372,7 @@ def history_entries history.set_value(10) expect(history_entries).to eq([ - ["original", nil, nil, 10], + ["original", nil, nil, 10] ]) end @@ -385,7 +385,7 @@ def history_entries history.set_value(20) expect(history_entries).to eq([ - ["original", nil, nil, 20], + ["original", nil, nil, 20] ]) end @@ -405,7 +405,7 @@ def history_entries expect(history_entries).to eq([ ["original", nil, nil, 10], - ["revised", 2, 2015, 20], + ["revised", 2, 2015, 20] ]) end @@ -425,7 +425,7 @@ def history_entries expect(history_entries).to eq([ ["original", nil, nil, 10], - ["revised", 2, 2015, 30], + ["revised", 2, 2015, 30] ]) end end diff --git a/spec/services/forecast_overview_spec.rb b/spec/services/forecast_overview_spec.rb index 775870c8c..edf894495 100644 --- a/spec/services/forecast_overview_spec.rb +++ b/spec/services/forecast_overview_spec.rb @@ -30,7 +30,7 @@ def forecast_values(records) expect(forecasts).to eq([ [2017, 1, 10], [2017, 2, 20], - [2017, 3, 40], + [2017, 3, 40] ]) end @@ -48,7 +48,7 @@ def forecast_values(records) expect(forecasts).to eq([ [2017, 1, 10], - [2017, 3, 40], + [2017, 3, 40] ]) end end @@ -104,7 +104,7 @@ def forecast_values(records) [2018, 1, 110], [2018, 2, 120], [2018, 3, 130], - [2018, 4, 140], + [2018, 4, 140] ]) end @@ -123,7 +123,7 @@ def forecast_values(records) [2017, 4, 70], [2018, 1, 110], [2018, 2, 120], - [2018, 3, 130], + [2018, 3, 130] ]) end end @@ -151,7 +151,7 @@ def forecast_values(records) [2017, 4, 20], [2018, 1, 30], [2018, 3, 40], - [2018, 4, 50], + [2018, 4, 50] ] } @@ -168,7 +168,7 @@ def forecast_values(records) [2017, 4, 70], [2018, 1, 30], [2018, 2, 80], - [2018, 4, 50], + [2018, 4, 50] ] } @@ -187,7 +187,7 @@ def forecast_values(records) [2017, 1, 10], [2017, 2, 60], [2017, 3, 100], - [2017, 4, 70], + [2017, 4, 70] ] expected_values.each do |year, quarter, amount| @@ -210,7 +210,7 @@ def forecast_values(records) [2017, 4, 20], [2018, 1, 30], [2018, 3, 40], - [2018, 4, 50], + [2018, 4, 50] ] } @@ -231,7 +231,7 @@ def forecast_values(records) expect(quarters).to eq([ [2016, 1], [2016, 1], - [2015, 4], + [2015, 4] ]) end @@ -246,7 +246,7 @@ def forecast_values(records) [2018, 1, 110], [2018, 2, 120], [2018, 3, 130], - [2018, 4, 140], + [2018, 4, 140] ]) end @@ -262,7 +262,7 @@ def forecast_values(records) [2018, 1, 110], [2018, 2, 120], [2018, 3, 130], - [2018, 4, 140], + [2018, 4, 140] ] } @@ -279,7 +279,7 @@ def forecast_values(records) [2017, 4, 70], [2018, 1, 30], [2018, 2, 80], - [2018, 4, 50], + [2018, 4, 50] ] } @@ -299,7 +299,7 @@ def forecast_values(records) it "only includes forecasts for the given activity" do expect(forecast_values(project_overview.latest_values)).to eq([ - [2019, 1, 200], + [2019, 1, 200] ]) expect(overview.latest_values).to all(satisfy { |forecast| @@ -341,7 +341,7 @@ def forecast_values forecasts[[programme, 2023, 1]].set_value(50) expect(forecast_values).to match_array([ - [programme, 2023, 1, 50], + [programme, 2023, 1, 50] ]) end @@ -367,7 +367,7 @@ def forecast_values [project_2, 2024, 1, 160], [third_party_project_3, 2024, 2, 320], - [third_party_project_4, 2024, 3, 640], + [third_party_project_4, 2024, 3, 640] ]) end @@ -376,7 +376,7 @@ def forecast_values forecasts[[programme, 2023, 1]].set_value(20) expect(forecast_values).to match_array([ - [programme, 2023, 1, 20], + [programme, 2023, 1, 20] ]) end @@ -386,7 +386,7 @@ def forecast_values forecasts[[project_2, 2023, 1]].set_value(20) expect(forecast_values).to match_array([ - [project_2, 2023, 1, 20], + [project_2, 2023, 1, 20] ]) end @@ -397,7 +397,7 @@ def forecast_values forecasts[[project_2, 2023, 1]].set_value(20) expect(forecast_values).to match_array([ - [project_2, 2023, 1, 20], + [project_2, 2023, 1, 20] ]) end @@ -412,7 +412,7 @@ def forecast_values expect(forecast_values).to match_array([ [programme, 2023, 1, 40], - [project_2, 2023, 1, 80], + [project_2, 2023, 1, 80] ]) end end diff --git a/spec/services/history_recorder_spec.rb b/spec/services/history_recorder_spec.rb index 56d5f582e..af51a2232 100644 --- a/spec/services/history_recorder_spec.rb +++ b/spec/services/history_recorder_spec.rb @@ -18,7 +18,7 @@ let(:changes) do { "title" => ["Original title", "Updated title"], - "description" => ["Original description", "Updated description"], + "description" => ["Original description", "Updated description"] } end @@ -64,7 +64,7 @@ let(:changes) do { "objectives" => ["Original objective", "New objective"], - "form_state" => ["purpose", "objectives"], + "form_state" => ["purpose", "objectives"] } end diff --git a/spec/services/import/commitments_spec.rb b/spec/services/import/commitments_spec.rb index fea1bb283..fc77ecd6b 100644 --- a/spec/services/import/commitments_spec.rb +++ b/spec/services/import/commitments_spec.rb @@ -101,7 +101,7 @@ invalid_errors = [ Import::Commitments::RowError.new("Value must be greater than 0", 2), Import::Commitments::RowError.new("Financial year can't be blank", 2), - Import::Commitments::RowError.new("Financial year is not a number", 2), + Import::Commitments::RowError.new("Financial year is not a number", 2) ] unknown_error = Import::Commitments::RowError.new("Unknown RODA identifier UNKNOWN-RODA-ID", 3) subject.call(invalid_csv) diff --git a/spec/services/import_actuals_spec.rb b/spec/services/import_actuals_spec.rb index 9fb8edb62..94a1f5a4c 100644 --- a/spec/services/import_actuals_spec.rb +++ b/spec/services/import_actuals_spec.rb @@ -28,7 +28,7 @@ "Value" => "50.00", "Receiving Organisation Name" => "Example University", "Receiving Organisation Type" => "80", - "Receiving Organisation IATI Reference" => "", + "Receiving Organisation IATI Reference" => "" } end @@ -84,7 +84,7 @@ it "returns an error" do expect(importer.errors).to eq([ - ImportActuals::Error.new(0, "Activity RODA Identifier", project.roda_identifier, t("importer.errors.actual.unauthorised")), + ImportActuals::Error.new(0, "Activity RODA Identifier", project.roda_identifier, t("importer.errors.actual.unauthorised")) ]) end end @@ -102,7 +102,7 @@ it "returns an error" do expect(importer.errors).to eq([ - ImportActuals::Error.new(0, "Activity RODA Identifier", another_project.roda_identifier, t("importer.errors.actual.unauthorised")), + ImportActuals::Error.new(0, "Activity RODA Identifier", another_project.roda_identifier, t("importer.errors.actual.unauthorised")) ]) end end @@ -118,7 +118,7 @@ it "returns an error" do expect(importer.errors).to eq([ - ImportActuals::Error.new(0, "Activity RODA Identifier", "not-a-real-id", t("importer.errors.actual.unknown_identifier")), + ImportActuals::Error.new(0, "Activity RODA Identifier", "not-a-real-id", t("importer.errors.actual.unknown_identifier")) ]) end end @@ -134,7 +134,7 @@ it "returns an error" do expect(importer.errors).to eq([ - ImportActuals::Error.new(0, "Financial Quarter", "", t("activerecord.errors.models.actual.attributes.financial_quarter.inclusion")), + ImportActuals::Error.new(0, "Financial Quarter", "", t("activerecord.errors.models.actual.attributes.financial_quarter.inclusion")) ]) end end @@ -150,7 +150,7 @@ it "returns an error" do expect(importer.errors).to eq([ - ImportActuals::Error.new(0, "Financial Year", "", t("activerecord.errors.models.actual.attributes.financial_year.blank")), + ImportActuals::Error.new(0, "Financial Year", "", t("activerecord.errors.models.actual.attributes.financial_year.blank")) ]) end end @@ -166,7 +166,7 @@ it "returns an error" do expect(importer.errors).to eq([ - ImportActuals::Error.new(0, "Financial Quarter", "5", t("activerecord.errors.models.actual.attributes.financial_quarter.inclusion")), + ImportActuals::Error.new(0, "Financial Quarter", "5", t("activerecord.errors.models.actual.attributes.financial_quarter.inclusion")) ]) end end @@ -197,7 +197,7 @@ it "returns an error" do expect(importer.errors).to eq([ - ImportActuals::Error.new(0, "Value", "", t("importer.errors.actual.non_numeric_value")), + ImportActuals::Error.new(0, "Value", "", t("importer.errors.actual.non_numeric_value")) ]) end end @@ -227,7 +227,7 @@ it "returns an error" do expect(importer.errors).to eq([ - ImportActuals::Error.new(0, "Value", "This is not a number", t("importer.errors.actual.non_numeric_value")), + ImportActuals::Error.new(0, "Value", "This is not a number", t("importer.errors.actual.non_numeric_value")) ]) end end @@ -243,7 +243,7 @@ it "returns an error" do expect(importer.errors).to eq([ - ImportActuals::Error.new(0, "Value", "3a4b5.c67", t("importer.errors.actual.non_numeric_value")), + ImportActuals::Error.new(0, "Value", "3a4b5.c67", t("importer.errors.actual.non_numeric_value")) ]) end end @@ -259,7 +259,7 @@ it "returns an error" do expect(importer.errors).to eq([ - ImportActuals::Error.new(0, "Receiving Organisation Name", "", t("activerecord.errors.models.actual.attributes.receiving_organisation_name.blank")), + ImportActuals::Error.new(0, "Receiving Organisation Name", "", t("activerecord.errors.models.actual.attributes.receiving_organisation_name.blank")) ]) end end @@ -276,7 +276,7 @@ it "returns an error" do expect(importer.errors).to eq([ - ImportActuals::Error.new(0, "Receiving Organisation Type", "81", t("importer.errors.actual.invalid_iati_organisation_type")), + ImportActuals::Error.new(0, "Receiving Organisation Type", "81", t("importer.errors.actual.invalid_iati_organisation_type")) ]) end end @@ -337,7 +337,7 @@ "Financial Year" => "2020", "Value" => "50.00", "Receiving Organisation Name" => "Example University", - "Receiving Organisation Type" => "80", + "Receiving Organisation Type" => "80" } end @@ -348,7 +348,7 @@ "Financial Year" => "2020", "Value" => "150.00", "Receiving Organisation Name" => "Example Corporation", - "Receiving Organisation Type" => "70", + "Receiving Organisation Type" => "70" } end @@ -359,7 +359,7 @@ "Financial Year" => "2019", "Value" => "£5,000", "Receiving Organisation Name" => "Example Foundation", - "Receiving Organisation Type" => "60", + "Receiving Organisation Type" => "60" } end @@ -367,7 +367,7 @@ importer.import([ first_actual_row, second_actual_row, - third_actual_row, + third_actual_row ]) end @@ -387,11 +387,11 @@ it "assigns each actual to the correct activity" do expect(project.actuals.pluck(:description)).to eq([ - "FQ4 1999-2000 spend on Example Project", + "FQ4 1999-2000 spend on Example Project" ]) expect(sibling_project.actuals.pluck(:description)).to eq([ "FQ4 1999-2000 spend on Sibling Project", - "FQ4 1999-2000 spend on Sibling Project", + "FQ4 1999-2000 spend on Sibling Project" ]) end @@ -407,7 +407,7 @@ it "returns an error" do expect(importer.errors).to eq([ - ImportActuals::Error.new(2, "Value", "fish", t("importer.errors.actual.non_numeric_value")), + ImportActuals::Error.new(2, "Value", "fish", t("importer.errors.actual.non_numeric_value")) ]) end end @@ -432,7 +432,7 @@ expect(errors).to eq([ ImportActuals::Error.new(0, "Receiving Organisation Type", "81", t("importer.errors.actual.invalid_iati_organisation_type")), ImportActuals::Error.new(0, "Value", "fish", t("importer.errors.actual.non_numeric_value")), - ImportActuals::Error.new(2, "Financial Quarter", third_actual_row["Financial Quarter"], t("activerecord.errors.models.actual.attributes.financial_quarter.inclusion")), + ImportActuals::Error.new(2, "Financial Quarter", third_actual_row["Financial Quarter"], t("activerecord.errors.models.actual.attributes.financial_quarter.inclusion")) ]) end end diff --git a/spec/services/import_converter_spec.rb b/spec/services/import_converter_spec.rb index 2df584b38..b59d4a1f7 100644 --- a/spec/services/import_converter_spec.rb +++ b/spec/services/import_converter_spec.rb @@ -15,7 +15,7 @@ "Act 2020/21 FY Q2 (Jul, Aug, Sep)" => "70", "Q3 2020-2021 actuals" => "50", "Act 2020/21 Q4" => "0", - "Q3 2020-2021 forecast" => "40", + "Q3 2020-2021 forecast" => "40" } end @@ -24,7 +24,7 @@ "Activity RODA Identifier", "Financial Year", "Financial Quarter", - "Value", + "Value" ]) end @@ -32,7 +32,7 @@ expect(converter.transaction_tuples).to eq([ ["AAA-BBB-CCC", "2020", "1", "90"], ["AAA-BBB-CCC", "2020", "2", "70"], - ["AAA-BBB-CCC", "2020", "3", "50"], + ["AAA-BBB-CCC", "2020", "3", "50"] ]) end @@ -43,7 +43,7 @@ expect(converter.transaction_tuples).to eq([ ["AAA-BBBCCC", "2020", "1", "90"], ["AAA-BBBCCC", "2020", "2", "70"], - ["AAA-BBBCCC", "2020", "3", "50"], + ["AAA-BBBCCC", "2020", "3", "50"] ]) end end @@ -58,7 +58,7 @@ "FC Q2 2020" => "80", "Q3 2020-2021 forecast" => "70", "FC 2020/21 FY Q4 (Jan, Feb, Mar)" => "60", - "Q3 2020-2021 actuals" => "50", + "Q3 2020-2021 actuals" => "50" } end @@ -68,13 +68,13 @@ "FC 2020/21 FY Q1", "FC 2020/21 FY Q2", "FC 2020/21 FY Q3", - "FC 2020/21 FY Q4", + "FC 2020/21 FY Q4" ]) end it "recognises all forecast headers" do expect(converter.forecast_tuples).to eq([ - ["AAA-BBB-CCC", "90", "80", "70", "60"], + ["AAA-BBB-CCC", "90", "80", "70", "60"] ]) end @@ -83,7 +83,7 @@ ["FC 2020/21 FY Q1", "FC Q1 2020-21"], ["FC 2020/21 FY Q2", "FC Q2 2020"], ["FC 2020/21 FY Q3", "Q3 2020-2021 forecast"], - ["FC 2020/21 FY Q4", "FC 2020/21 FY Q4 (Jan, Feb, Mar)"], + ["FC 2020/21 FY Q4", "FC 2020/21 FY Q4 (Jan, Feb, Mar)"] ]) end @@ -92,13 +92,13 @@ [ ["FC 2020/21 FY Q3", "Q3 2020-2021 forecast"], ["FC 2020/21 FY Q2", "FC Q2 2020"], - ["FC 2020/21 FY Q4", "FC 2020/21 FY Q4 (Jan, Feb, Mar)"], + ["FC 2020/21 FY Q4", "FC 2020/21 FY Q4 (Jan, Feb, Mar)"] ] end it "returns forecast values in the matching order" do expect(converter.forecast_tuples).to eq([ - ["AAA-BBB-CCC", "70", "80", "60"], + ["AAA-BBB-CCC", "70", "80", "60"] ]) end end diff --git a/spec/services/import_forecasts_spec.rb b/spec/services/import_forecasts_spec.rb index 4790aded8..af0951472 100644 --- a/spec/services/import_forecasts_spec.rb +++ b/spec/services/import_forecasts_spec.rb @@ -25,7 +25,7 @@ def forecast_values [ forecast.financial_quarter, forecast.financial_year, - forecast.value, + forecast.value ] end end @@ -37,7 +37,7 @@ def forecast_values { "Activity RODA Identifier" => project.roda_identifier, "FC 2020/21 FY Q3 (Oct, Nov, Dec)" => "200436", - "FC 2020/21 FY Q4 (Jan, Feb, Mar)" => "310793", + "FC 2020/21 FY Q4 (Jan, Feb, Mar)" => "310793" } end @@ -60,7 +60,7 @@ def forecast_values "FC 2020/21 FY Q3 (Oct, Nov, Dec)" => "200436", "FC 2020/21 FY Q4 (Jan, Feb, Mar)" => "310793", "FC 2021/22 FY Q1 (Apr, May, Jun)" => "984150", - "FC 2021/22 FY Q2 (Jul, Aug, Sep)" => "206206", + "FC 2021/22 FY Q2 (Jul, Aug, Sep)" => "206206" } end @@ -73,7 +73,7 @@ def forecast_values [3, 2020, 200_436.0], [4, 2020, 310_793.0], [1, 2021, 984_150.0], - [2, 2021, 206_206.0], + [2, 2021, 206_206.0] ]) end end @@ -85,14 +85,14 @@ def forecast_values importer.import([ { "Activity RODA Identifier" => project.roda_identifier, - "FC 2020/21 FY Q3 (Oct, Nov, Dec)" => "40", - }, + "FC 2020/21 FY Q3 (Oct, Nov, Dec)" => "40" + } ]) end it "reports an error" do expect(importer.errors).to eq([ - ImportForecasts::Error.new(0, "Activity RODA Identifier", project.roda_identifier, t("importer.errors.forecast.unauthorised")), + ImportForecasts::Error.new(0, "Activity RODA Identifier", project.roda_identifier, t("importer.errors.forecast.unauthorised")) ]) end @@ -106,14 +106,14 @@ def forecast_values importer.import([ { "Activity RODA Identifier" => "not-really-an-id", - "FC 2020/21 FY Q3 (Oct, Nov, Dec)" => "200436", - }, + "FC 2020/21 FY Q3 (Oct, Nov, Dec)" => "200436" + } ]) end it "reports an error" do expect(importer.errors).to eq([ - ImportForecasts::Error.new(0, "Activity RODA Identifier", "not-really-an-id", t("importer.errors.forecast.unknown_identifier")), + ImportForecasts::Error.new(0, "Activity RODA Identifier", "not-really-an-id", t("importer.errors.forecast.unknown_identifier")) ]) end @@ -127,14 +127,14 @@ def forecast_values importer.import([ { "Activity RODA Identifier" => project.roda_identifier, - "FC 2020/21 FY Q3 (Oct, Nov, Dec)" => "not a number", - }, + "FC 2020/21 FY Q3 (Oct, Nov, Dec)" => "not a number" + } ]) end it "reports an error" do expect(importer.errors).to eq([ - ImportForecasts::Error.new(0, "FC 2020/21 FY Q3 (Oct, Nov, Dec)", "not a number", t("importer.errors.forecast.non_numeric_value")), + ImportForecasts::Error.new(0, "FC 2020/21 FY Q3 (Oct, Nov, Dec)", "not a number", t("importer.errors.forecast.non_numeric_value")) ]) end @@ -148,14 +148,14 @@ def forecast_values importer.import([ { "Activity RODA Identifier" => project.roda_identifier, - "FC 2015/16 FY Q3 (Oct, Nov, Dec)" => "200436", - }, + "FC 2015/16 FY Q3 (Oct, Nov, Dec)" => "200436" + } ]) end it "reports an error" do expect(importer.errors).to eq([ - ImportForecasts::Error.new(0, "FC 2015/16 FY Q3 (Oct, Nov, Dec)", "FC 2015/16 FY Q3 (Oct, Nov, Dec)", t("importer.errors.forecast.in_the_past")), + ImportForecasts::Error.new(0, "FC 2015/16 FY Q3 (Oct, Nov, Dec)", "FC 2015/16 FY Q3 (Oct, Nov, Dec)", t("importer.errors.forecast.in_the_past")) ]) end @@ -170,8 +170,8 @@ def forecast_values { "Activity RODA Identifier" => project.roda_identifier, "FC 2020/21 FY Q3 (Oct, Nov, Dec)" => "", - "FC 2020/21 FY Q4 (Jan, Feb, Mar)" => "310793", - }, + "FC 2020/21 FY Q4 (Jan, Feb, Mar)" => "310793" + } ]) end @@ -181,7 +181,7 @@ def forecast_values it "imports the forecasts, ignoring blank cells" do expect(forecast_values).to eq([ - [4, 2020, 310_793.0], + [4, 2020, 310_793.0] ]) end end @@ -195,7 +195,7 @@ def forecast_values "Activity RODA Identifier" => project.roda_identifier, "FC 2020/21 FY Q3 (Oct, Nov, Dec)" => "10", "FC 2020/21 FY Q4 (Jan, Feb, Mar)" => "20", - "Unknown Column" => "", + "Unknown Column" => "" }, { "Activity Name" => "", @@ -203,14 +203,14 @@ def forecast_values "Activity RODA Identifier" => project.roda_identifier, "FC 2020/21 FY Q3 (Oct, Nov, Dec)" => "10", "FC 2020/21 FY Q4 (Jan, Feb, Mar)" => "20", - "Unknown Column" => "", - }, + "Unknown Column" => "" + } ]) end it "reports an error" do expect(importer.errors).to eq([ - ImportForecasts::Error.new(-1, "Unknown Column", "", t("importer.errors.forecast.unrecognised_column")), + ImportForecasts::Error.new(-1, "Unknown Column", "", t("importer.errors.forecast.unrecognised_column")) ]) end @@ -234,7 +234,7 @@ def forecast_values "FC 2020/21 FY Q3 (Oct, Nov, Dec)" => "200436", "FC 2020/21 FY Q4 (Jan, Feb, Mar)" => "310793", "FC 2021/22 FY Q1 (Apr, May, Jun)" => "984150", - "FC 2021/22 FY Q2 (Jul, Aug, Sep)" => "206206", + "FC 2021/22 FY Q2 (Jul, Aug, Sep)" => "206206" } end @@ -247,7 +247,7 @@ def forecast_values [3, 2020, 200_436.0], [4, 2020, 310_793.0], [1, 2021, 984_150.0], - [2, 2021, 206_206.0], + [2, 2021, 206_206.0] ]) end @@ -266,8 +266,8 @@ def forecast_values importer.import([ { "Activity RODA Identifier" => project.roda_identifier, - "FC 2020/21 FY Q3 (Oct, Nov, Dec)" => "200436", - }, + "FC 2020/21 FY Q3 (Oct, Nov, Dec)" => "200436" + } ]) end @@ -279,8 +279,8 @@ def forecast_values nil, "The report #{selected_report.id} (#{organisation}, FQ1 2020-2021 for #{fund}, approved)\ is not the latest for that organisation and fund. The latest is #{latest_report.id},\ - for FQ2 2020-2021 (active).", - ), + for FQ2 2020-2021 (active)." + ) ]) end @@ -299,12 +299,12 @@ def forecast_values importer.import([ { "Activity RODA Identifier" => project.roda_identifier, - "FC 2020/21 FY Q3 (Oct, Nov, Dec)" => "200436", + "FC 2020/21 FY Q3 (Oct, Nov, Dec)" => "200436" }, { "Activity RODA Identifier" => unrelated_project.roda_identifier, - "FC 2020/21 FY Q4 (Jan, Feb, Mar)" => "310793", - }, + "FC 2020/21 FY Q4 (Jan, Feb, Mar)" => "310793" + } ]) end @@ -314,8 +314,8 @@ def forecast_values 1, "Activity RODA Identifier", unrelated_project.roda_identifier, - "The activity is not related to the report, which belongs to #{fund} and #{organisation}.", - ), + "The activity is not related to the report, which belongs to #{fund} and #{organisation}." + ) ]) end diff --git a/spec/services/refund/grouped_refund_fetcher_spec.rb b/spec/services/refund/grouped_refund_fetcher_spec.rb index 4b1927145..df497ee1b 100644 --- a/spec/services/refund/grouped_refund_fetcher_spec.rb +++ b/spec/services/refund/grouped_refund_fetcher_spec.rb @@ -28,7 +28,7 @@ expect(subject.call).to eq({ activity1 => activity1_refunds, - activity2 => activity2_refunds, + activity2 => activity2_refunds }) end end diff --git a/spec/services/refund/overview_spec.rb b/spec/services/refund/overview_spec.rb index 9ecbe9a70..dcaffe650 100644 --- a/spec/services/refund/overview_spec.rb +++ b/spec/services/refund/overview_spec.rb @@ -57,7 +57,7 @@ [1, 2018, -30], [2, 2018, 0], [3, 2018, -10], - [4, 2018, -120], + [4, 2018, -120] ] } @@ -74,7 +74,7 @@ [1, 2018, -30], [2, 2018, 0], [3, 2018, -10], - [4, 2018, -120], + [4, 2018, -120] ] } @@ -94,7 +94,7 @@ [1, 2018, -30], [2, 2018, -1_000], [3, 2018, -70], - [4, 2018, -120], + [4, 2018, -120] ] } @@ -111,7 +111,7 @@ [1, 2018, -30], [2, 2018, -1_000], [3, 2018, -70], - [4, 2018, -120], + [4, 2018, -120] ] } @@ -131,7 +131,7 @@ [1, 2018, -930], [2, 2018, -1_480], [3, 2018, -980], - [4, 2018, -930], + [4, 2018, -930] ] } @@ -148,7 +148,7 @@ [1, 2018, -930], [2, 2018, -1_480], [3, 2018, -980], - [4, 2018, -930], + [4, 2018, -930] ] } diff --git a/spec/services/report/export_spec.rb b/spec/services/report/export_spec.rb index 7b630c6ce..d56124df2 100644 --- a/spec/services/report/export_spec.rb +++ b/spec/services/report/export_spec.rb @@ -64,7 +64,7 @@ "FC FQ2 2025-2026", "FC FQ3 2025-2026", "FC FQ4 2025-2026", - "FC FQ1 2026-2027", + "FC FQ1 2026-2027" ) end @@ -100,7 +100,7 @@ following_report_quarters: an_instance_of(Array), actual_quarters: an_instance_of(Actual::Overview::AllQuarters), refund_quarters: an_instance_of(Refund::Overview::AllQuarters), - change_state: an_instance_of(Array), + change_state: an_instance_of(Array) ).and_return(stub) expect(stub).to receive(:call).and_return([activity.title]) end @@ -111,7 +111,7 @@ [activities[2].title], [activities[3].title], [activities[4].title], - [activities[5].title], + [activities[5].title] ]) end end @@ -140,7 +140,7 @@ FinancialQuarter.new(2020, 1), FinancialQuarter.new(2020, 2), FinancialQuarter.new(2020, 3), - FinancialQuarter.new(2020, 4), + FinancialQuarter.new(2020, 4) ] end let(:following_report_quarters) do @@ -148,7 +148,7 @@ FinancialQuarter.new(2021, 1), FinancialQuarter.new(2021, 2), FinancialQuarter.new(2021, 3), - FinancialQuarter.new(2021, 4), + FinancialQuarter.new(2021, 4) ] end @@ -156,14 +156,14 @@ [ Actual.new(financial_quarter: 1, financial_year: 2020, value: 20, parent_activity: activity), Actual.new(financial_quarter: 2, financial_year: 2020, value: 40, parent_activity: activity), - Actual.new(financial_quarter: 3, financial_year: 2020, value: 80, parent_activity: activity), + Actual.new(financial_quarter: 3, financial_year: 2020, value: 80, parent_activity: activity) ] end let(:refunds) do [ Refund.new(financial_quarter: 1, financial_year: 2020, value: -5, parent_activity: activity), - Refund.new(financial_quarter: 2, financial_year: 2020, value: -10, parent_activity: activity), + Refund.new(financial_quarter: 2, financial_year: 2020, value: -10, parent_activity: activity) ] end @@ -181,7 +181,7 @@ following_report_quarters: following_report_quarters, actual_quarters: actual_quarters, refund_quarters: refund_quarters, - change_state: ["Changed"], + change_state: ["Changed"] ) end @@ -241,7 +241,7 @@ comments.map(&:body).join("\n"), fund.name, extending_organisation.beis_organisation_reference, - "http://example.com", + "http://example.com" ]) end @@ -262,7 +262,7 @@ "", fund.name, extending_organisation.beis_organisation_reference, - "http://example.com", + "http://example.com" ]) end end diff --git a/spec/services/report/grouped_comments_fetcher_spec.rb b/spec/services/report/grouped_comments_fetcher_spec.rb index b2f0154aa..e2fff24d9 100644 --- a/spec/services/report/grouped_comments_fetcher_spec.rb +++ b/spec/services/report/grouped_comments_fetcher_spec.rb @@ -6,7 +6,7 @@ [ build(:project_activity, id: SecureRandom.uuid), build(:project_activity, id: SecureRandom.uuid), - build(:project_activity, id: SecureRandom.uuid), + build(:project_activity, id: SecureRandom.uuid) ] end @@ -15,7 +15,7 @@ build_list(:comment, 3, commentable: activities[0]), build_list(:comment, 2, commentable: activities[1]), build(:comment, commentable: build(:refund, parent_activity: activities[0]), commentable_type: "Refund"), - build(:comment, commentable: build(:adjustment, parent_activity: activities[1]), commentable_type: "Adjustment"), + build(:comment, commentable: build(:adjustment, parent_activity: activities[1]), commentable_type: "Adjustment") ] end @@ -25,7 +25,7 @@ let(:grouped_comments) do { activities[0] => first_activity_comments, - activities[1] => second_activity_comments, + activities[1] => second_activity_comments } end @@ -44,8 +44,8 @@ commentable: [ :parent_activity, parent: [ - parent: [:parent], - ], + parent: [:parent] + ] ] ).and_return(comments.flatten) diff --git a/spec/services/report/grouped_reports_fetcher_spec.rb b/spec/services/report/grouped_reports_fetcher_spec.rb index 6ea144760..1545580e3 100644 --- a/spec/services/report/grouped_reports_fetcher_spec.rb +++ b/spec/services/report/grouped_reports_fetcher_spec.rb @@ -18,7 +18,7 @@ expect(described_class.new.approved).to eq({ organisation1 => organisation1_approved_reports, - organisation2 => organisation2_approved_reports, + organisation2 => organisation2_approved_reports }) end end @@ -37,7 +37,7 @@ expect(described_class.new.current).to eq({ organisation1 => organisation1_unapproved_reports, - organisation2 => organisation2_unapproved_reports, + organisation2 => organisation2_unapproved_reports }) end end diff --git a/spec/services/transaction/grouped_actuals_fetcher_spec.rb b/spec/services/transaction/grouped_actuals_fetcher_spec.rb index c634c8b63..b45da53aa 100644 --- a/spec/services/transaction/grouped_actuals_fetcher_spec.rb +++ b/spec/services/transaction/grouped_actuals_fetcher_spec.rb @@ -28,7 +28,7 @@ expect(subject.call).to eq({ activity1 => activity1_actuals, - activity2 => activity2_actuals, + activity2 => activity2_actuals }) end end diff --git a/spec/services/update_actual_spec.rb b/spec/services/update_actual_spec.rb index 66eda38c5..f4fe062db 100644 --- a/spec/services/update_actual_spec.rb +++ b/spec/services/update_actual_spec.rb @@ -26,7 +26,7 @@ let(:expected_changes) do { "value" => [BigDecimal("101.01"), BigDecimal("202.02")], - "financial_quarter" => [1, 2], + "financial_quarter" => [1, 2] } end diff --git a/spec/services/update_budget_spec.rb b/spec/services/update_budget_spec.rb index 0d7272f78..7d69ece33 100644 --- a/spec/services/update_budget_spec.rb +++ b/spec/services/update_budget_spec.rb @@ -44,7 +44,7 @@ ActionController::Parameters.new( budget_type: :other_official, value: 105, - financial_year: 2015, + financial_year: 2015 ).permit! end @@ -59,7 +59,7 @@ changes: { budget_type: [budget.budget_type, "other_official"], value: [budget.value, 105], - financial_year: [budget.financial_year.start_year, 2015], + financial_year: [budget.financial_year.start_year, 2015] }, reference: "Change to Budget", activity: budget.parent_activity, @@ -110,7 +110,7 @@ budget_type: [budget.budget_type, "other_official"], providing_organisation_name: [nil, "Test Organisation"], providing_organisation_reference: [nil, "GB-TEST-02"], - providing_organisation_type: [nil, "80"], + providing_organisation_type: [nil, "80"] }, reference: "Change to Budget", activity: budget.parent_activity, @@ -134,7 +134,7 @@ describe "changing to 'direct'" do let(:attributes) do ActionController::Parameters.new( - budget_type: :direct, + budget_type: :direct ).permit! end let(:result) { subject.call(attributes: attributes) } @@ -145,7 +145,7 @@ budget_type: [budget.budget_type, "direct"], providing_organisation_name: [budget.providing_organisation_name, nil], providing_organisation_reference: [budget.providing_organisation_reference, nil], - providing_organisation_type: [budget.providing_organisation_type, nil], + providing_organisation_type: [budget.providing_organisation_type, nil] }, reference: "Change to Budget", activity: budget.parent_activity, diff --git a/spec/services/update_refund_spec.rb b/spec/services/update_refund_spec.rb index 138fb4c47..ff70e8c16 100644 --- a/spec/services/update_refund_spec.rb +++ b/spec/services/update_refund_spec.rb @@ -17,7 +17,7 @@ { "value" => [-BigDecimal("101.01"), -BigDecimal("202.02")], "financial_quarter" => [1, 2], - "comment" => [original_comment, "Updated text"], + "comment" => [original_comment, "Updated text"] } end diff --git a/spec/services/update_user_in_auth0_spec.rb b/spec/services/update_user_in_auth0_spec.rb index 111cec410..c316bcdbf 100644 --- a/spec/services/update_user_in_auth0_spec.rb +++ b/spec/services/update_user_in_auth0_spec.rb @@ -20,7 +20,7 @@ auth0_update_call = stub_auth0_update_user_request( auth0_identifier: "auth0|555ffff", email: user.email, - name: updated_name, + name: updated_name ) subject.call @@ -34,7 +34,7 @@ auth0_update_call = stub_auth0_update_user_request( auth0_identifier: "auth0|555ffff", email: updated_email, - name: user.name, + name: user.name ) subject.call @@ -46,7 +46,7 @@ auth0_update_call = stub_auth0_update_user_request( auth0_identifier: "auth0|555ffff", email: "new@example.com", - name: "New Name", + name: "New Name" ) subject.call @@ -63,7 +63,7 @@ "statusCode" => 500, "error" => "Foo", "message" => "Bar", - "errorCode" => "x_error", + "errorCode" => "x_error" }] unexpected_error = Auth0::Unsupported.new(params) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5f3030731..45130f92c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,7 +5,7 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([ SimpleCov::Formatter::HTMLFormatter, - Coveralls::SimpleCov::Formatter, + Coveralls::SimpleCov::Formatter ]) SimpleCov.minimum_coverage 98 @@ -31,7 +31,7 @@ RSpec.configure do |config| allowed_http_requests = [ "localhost", - "127.0.0.1", # Required for Capybara sessions + "127.0.0.1" # Required for Capybara sessions ] WebMock.disable_net_connect!(allow: allowed_http_requests) diff --git a/spec/support/authentication_helpers.rb b/spec/support/authentication_helpers.rb index d0dd5ea0f..b3a77cd53 100644 --- a/spec/support/authentication_helpers.rb +++ b/spec/support/authentication_helpers.rb @@ -5,7 +5,7 @@ def mock_successful_authentication(uid: "12345", name: "Alex", email: "alex@exam uid: uid, info: { name: name, - email: email, + email: email } ) end diff --git a/spec/support/export_helpers.rb b/spec/support/export_helpers.rb index bc3b871d5..c6b20eec5 100644 --- a/spec/support/export_helpers.rb +++ b/spec/support/export_helpers.rb @@ -27,7 +27,7 @@ def forecasts_for_report_from_table(report, table) @activity, report: report, financial_quarter: row["financial_quarter"].to_i, - financial_year: row["financial_year"].to_i, + financial_year: row["financial_year"].to_i ).set_value(row["value"].to_i) end end @@ -38,7 +38,7 @@ def fixture_attrs(row) value: row["value"].strip, financial_quarter: row["financial_period"][/\d/], financial_year: 2020, - report: instance_variable_get("@#{row["report"].strip}_report"), + report: instance_variable_get("@#{row["report"].strip}_report") } end end diff --git a/spec/support/matchers/validate_attribute_matcher.rb b/spec/support/matchers/validate_attribute_matcher.rb index 644a5a4d8..95854a06e 100644 --- a/spec/support/matchers/validate_attribute_matcher.rb +++ b/spec/support/matchers/validate_attribute_matcher.rb @@ -1,7 +1,7 @@ RSpec::Matchers.define :validate_attribute do |attribute| match do |subject| validators = subject.class.validators_on(attribute).select { |validator| - validator.class == @validator_class + validator.instance_of?(@validator_class) } validators.present? diff --git a/spec/views/layouts/application_spec.rb b/spec/views/layouts/application_spec.rb index a59371c38..3b76e082a 100644 --- a/spec/views/layouts/application_spec.rb +++ b/spec/views/layouts/application_spec.rb @@ -1,4 +1,5 @@ RSpec.describe "layouts/application" do + # standard:disable Lint/ConstantDefinitionInBlock class ActionView::TestCase::TestController include Auth @@ -6,6 +7,7 @@ def current_user nil end end + # standard:enable Lint/ConstantDefinitionInBlock it "shows the meta tags when ROBOT_NOINDEX is set to true" do ClimateControl.modify ROBOT_NOINDEX: "true" do diff --git a/spec/views/staff/exports/organisations/show_spec.rb b/spec/views/staff/exports/organisations/show_spec.rb index 5bef34066..6a505dc68 100644 --- a/spec/views/staff/exports/organisations/show_spec.rb +++ b/spec/views/staff/exports/organisations/show_spec.rb @@ -3,7 +3,7 @@ let(:xml_downloads) do [ double("Iati::XmlDownload", title: "XML Download 1", path: "http://example.com/1"), - double("Iati::XmlDownload", title: "XML Download 2", path: "http://example.com/2"), + double("Iati::XmlDownload", title: "XML Download 2", path: "http://example.com/2") ] end diff --git a/spec/views/staff/shared/reports/_table_variance_spec.rb b/spec/views/staff/shared/reports/_table_variance_spec.rb index c632478f2..8d04e2b32 100644 --- a/spec/views/staff/shared/reports/_table_variance_spec.rb +++ b/spec/views/staff/shared/reports/_table_variance_spec.rb @@ -13,7 +13,7 @@ render partial: "staff/shared/reports/table_variance", locals: { activities: [activity], - readonly: false, + readonly: false } end diff --git a/spec/views/staff/shared/xml/activity_spec.rb b/spec/views/staff/shared/xml/activity_spec.rb index 3451600a8..1df1b6221 100644 --- a/spec/views/staff/shared/xml/activity_spec.rb +++ b/spec/views/staff/shared/xml/activity_spec.rb @@ -4,14 +4,14 @@ before do reporting_organisation = build(:delivery_partner_organisation) render partial: "staff/shared/xml/activity", - locals: { - activity: activity, - reporting_organisation: reporting_organisation, - transactions: nil, - budgets: nil, - forecasts: nil, - commitment: commitment, - } + locals: { + activity: activity, + reporting_organisation: reporting_organisation, + transactions: nil, + budgets: nil, + forecasts: nil, + commitment: commitment + } end context "when there is a commitment" do