diff --git a/.rubocop.yml b/.rubocop.yml index 982341268..b0b25095f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -108,6 +108,9 @@ Layout/MultilineHashBraceLayout: Layout/MultilineHashKeyLineBreaks: Enabled: true +Layout/MultilineMethodCallIndentation: + Enabled: true + Layout/MultilineOperationIndentation: Enabled: true diff --git a/app/components/budgets/executions/image_component.rb b/app/components/budgets/executions/image_component.rb index 3058ee46d..d81e225e5 100644 --- a/app/components/budgets/executions/image_component.rb +++ b/app/components/budgets/executions/image_component.rb @@ -9,7 +9,9 @@ class Budgets::Executions::ImageComponent < ApplicationComponent private def milestone - investment.milestones.order_by_publication_date - .select { |milestone| milestone.image.present? }.last + investment.milestones + .order_by_publication_date + .select { |milestone| milestone.image.present? } + .last end end diff --git a/app/controllers/admin/legislation/processes_controller.rb b/app/controllers/admin/legislation/processes_controller.rb index 7396ca654..370236008 100644 --- a/app/controllers/admin/legislation/processes_controller.rb +++ b/app/controllers/admin/legislation/processes_controller.rb @@ -8,8 +8,9 @@ class Admin::Legislation::ProcessesController < Admin::Legislation::BaseControll load_and_authorize_resource :process, class: "Legislation::Process" def index - @processes = ::Legislation::Process.send(@current_filter).order(start_date: :desc) - .page(params[:page]) + @processes = ::Legislation::Process.send(@current_filter) + .order(start_date: :desc) + .page(params[:page]) end def create diff --git a/app/controllers/admin/poll/officer_assignments_controller.rb b/app/controllers/admin/poll/officer_assignments_controller.rb index 008918c3f..82e45a182 100644 --- a/app/controllers/admin/poll/officer_assignments_controller.rb +++ b/app/controllers/admin/poll/officer_assignments_controller.rb @@ -5,11 +5,11 @@ class Admin::Poll::OfficerAssignmentsController < Admin::Poll::BaseController def index @officers = ::Poll::Officer - .includes(:user) - .order("users.username") - .where( - id: @poll.officer_assignments.select(:officer_id).distinct.map(&:officer_id) - ).page(params[:page]).per(50) + .includes(:user) + .order("users.username") + .where(id: @poll.officer_assignments.select(:officer_id).distinct.map(&:officer_id)) + .page(params[:page]) + .per(50) end def by_officer diff --git a/app/controllers/admin/verifications_controller.rb b/app/controllers/admin/verifications_controller.rb index 3e3671ec3..f4a8b3669 100644 --- a/app/controllers/admin/verifications_controller.rb +++ b/app/controllers/admin/verifications_controller.rb @@ -4,9 +4,10 @@ class Admin::VerificationsController < Admin::BaseController end def search - @users = User.incomplete_verification.search(params[:search]) - .page(params[:page]) - .for_render + @users = User.incomplete_verification + .search(params[:search]) + .page(params[:page]) + .for_render render :index end end diff --git a/app/controllers/dashboard/achievements_controller.rb b/app/controllers/dashboard/achievements_controller.rb index 320dbc2ce..3a1aa34c6 100644 --- a/app/controllers/dashboard/achievements_controller.rb +++ b/app/controllers/dashboard/achievements_controller.rb @@ -37,11 +37,11 @@ class Dashboard::AchievementsController < Dashboard::BaseController def executed_proposed_actions @executed_proposed_actions ||= Dashboard::ExecutedAction - .joins(:action) - .includes(:action) - .where(proposal: proposal) - .where(executed_at: start_date.beginning_of_day..end_date.end_of_day) - .where(dashboard_actions: { action_type: 0 }) - .order(executed_at: :asc) + .joins(:action) + .includes(:action) + .where(proposal: proposal) + .where(executed_at: start_date.beginning_of_day..end_date.end_of_day) + .where(dashboard_actions: { action_type: 0 }) + .order(executed_at: :asc) end end diff --git a/app/controllers/legislation/processes_controller.rb b/app/controllers/legislation/processes_controller.rb index 3ceff8392..c24206182 100644 --- a/app/controllers/legislation/processes_controller.rb +++ b/app/controllers/legislation/processes_controller.rb @@ -10,8 +10,11 @@ class Legislation::ProcessesController < Legislation::BaseController def index @current_filter ||= "open" - @processes = ::Legislation::Process.send(@current_filter).published - .not_in_draft.order(start_date: :desc).page(params[:page]) + @processes = ::Legislation::Process.send(@current_filter) + .published + .not_in_draft + .order(start_date: :desc) + .page(params[:page]) end def show diff --git a/app/controllers/officing/ballot_sheets_controller.rb b/app/controllers/officing/ballot_sheets_controller.rb index fcface1e9..814d26788 100644 --- a/app/controllers/officing/ballot_sheets_controller.rb +++ b/app/controllers/officing/ballot_sheets_controller.rb @@ -43,12 +43,12 @@ class Officing::BallotSheetsController < Officing::BaseController def load_officer_assignments @officer_assignments = ::Poll::OfficerAssignment - .includes(booth_assignment: [:booth]) - .joins(:booth_assignment) - .final - .where(id: current_user.poll_officer.officer_assignment_ids) - .where(poll_booth_assignments: { poll_id: @poll.id }) - .where(date: Date.current) + .includes(booth_assignment: [:booth]) + .joins(:booth_assignment) + .final + .where(id: current_user.poll_officer.officer_assignment_ids) + .where(poll_booth_assignments: { poll_id: @poll.id }) + .where(date: Date.current) end def load_officer_assignment diff --git a/app/controllers/officing/results_controller.rb b/app/controllers/officing/results_controller.rb index 795122400..543607b0c 100644 --- a/app/controllers/officing/results_controller.rb +++ b/app/controllers/officing/results_controller.rb @@ -22,11 +22,11 @@ class Officing::ResultsController < Officing::BaseController def index @booth_assignment = ::Poll::BoothAssignment.includes(:booth).find(index_params[:booth_assignment_id]) if current_user.poll_officer.officer_assignments.final - .where(booth_assignment_id: @booth_assignment.id).exists? + .where(booth_assignment_id: @booth_assignment.id).exists? @partial_results = ::Poll::PartialResult.includes(:question) - .where(booth_assignment_id: index_params[:booth_assignment_id]) - .where(date: index_params[:date]) + .where(booth_assignment_id: index_params[:booth_assignment_id]) + .where(date: index_params[:date]) @recounts = ::Poll::Recount.where(booth_assignment_id: @booth_assignment.id, date: index_params[:date]) end end @@ -90,17 +90,17 @@ class Officing::ResultsController < Officing::BaseController def load_officer_assignment @officer_assignment = current_user.poll_officer - .officer_assignments.final.find_by(id: results_params[:officer_assignment_id]) + .officer_assignments.final.find_by(id: results_params[:officer_assignment_id]) end def load_officer_assignments @officer_assignments = ::Poll::OfficerAssignment - .includes(booth_assignment: [:booth]) - .joins(:booth_assignment) - .final - .where(id: current_user.poll_officer.officer_assignment_ids) - .where(poll_booth_assignments: { poll_id: @poll.id }) - .where(date: Date.current) + .includes(booth_assignment: [:booth]) + .joins(:booth_assignment) + .final + .where(id: current_user.poll_officer.officer_assignment_ids) + .where(poll_booth_assignments: { poll_id: @poll.id }) + .where(date: Date.current) end def load_partial_results diff --git a/app/controllers/proposals_controller.rb b/app/controllers/proposals_controller.rb index 23a186151..656df3e5e 100644 --- a/app/controllers/proposals_controller.rb +++ b/app/controllers/proposals_controller.rb @@ -155,8 +155,10 @@ class ProposalsController < ApplicationController return unless !@advanced_search_terms && @search_terms.blank? && params[:retired].blank? && @current_order != "recommendations" if Setting["feature.featured_proposals"] - @featured_proposals = Proposal.not_archived.unsuccessful - .sort_by_confidence_score.limit(Setting["featured_proposals_number"]) + @featured_proposals = Proposal.not_archived + .unsuccessful + .sort_by_confidence_score + .limit(Setting["featured_proposals_number"]) if @featured_proposals.present? @resources = @resources.where.not(id: @featured_proposals) end diff --git a/app/helpers/admin_budget_investments_helper.rb b/app/helpers/admin_budget_investments_helper.rb index d3d73988b..014118fd5 100644 --- a/app/helpers/admin_budget_investments_helper.rb +++ b/app/helpers/admin_budget_investments_helper.rb @@ -23,7 +23,7 @@ module AdminBudgetInvestmentsHelper def valuator_select_options(budget) budget.valuators.order("description ASC").order("users.email ASC").includes(:user) - .map { |v| [v.description_or_email, "valuator_#{v.id}"] } + .map { |v| [v.description_or_email, "valuator_#{v.id}"] } end def valuator_group_select_options diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1377b27d2..fb69f2bb9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -48,7 +48,7 @@ module ApplicationHelper def self.asset_data_base64(path) asset = (Rails.application.assets || ::Sprockets::Railtie.build_environment(Rails.application)) - .find_asset(path) + .find_asset(path) throw "Could not find asset '#{path}'" if asset.nil? base64 = Base64.encode64(asset.to_s).gsub(/\s+/, "") "data:#{asset.content_type};base64,#{Rack::Utils.escape(base64)}" diff --git a/app/models/budget/group.rb b/app/models/budget/group.rb index 9ca141725..a2e0164e4 100644 --- a/app/models/budget/group.rb +++ b/app/models/budget/group.rb @@ -11,8 +11,8 @@ class Budget def name_uniqueness_by_budget if budget.groups.joins(:translations) - .where(name: name) - .where.not("budget_group_translations.budget_group_id": budget_group_id).any? + .where(name: name) + .where.not("budget_group_translations.budget_group_id": budget_group_id).any? errors.add(:name, I18n.t("errors.messages.taken")) end end diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index 34c2ec2eb..61fe46bc3 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -199,7 +199,7 @@ class Budget with_joins = with_translations(Globalize.fallbacks(I18n.locale)) with_joins.where(id: title_or_id) - .or(with_joins.where("budget_investment_translations.title ILIKE ?", "%#{title_or_id}%")) + .or(with_joins.where("budget_investment_translations.title ILIKE ?", "%#{title_or_id}%")) end def searchable_values diff --git a/app/models/budget/stats.rb b/app/models/budget/stats.rb index bbf01de17..3837bb0f8 100644 --- a/app/models/budget/stats.rb +++ b/app/models/budget/stats.rb @@ -129,8 +129,8 @@ class Budget::Stats def balloters_by_heading(heading_id) stats_cache("balloters_by_heading_#{heading_id}") do budget.ballots.joins(:lines) - .where(budget_ballot_lines: { heading_id: heading_id }) - .distinct.pluck(:user_id) + .where(budget_ballot_lines: { heading_id: heading_id }) + .distinct.pluck(:user_id) end end diff --git a/app/models/concerns/globalizable.rb b/app/models/concerns/globalizable.rb index 0b995350d..8961620e8 100644 --- a/app/models/concerns/globalizable.rb +++ b/app/models/concerns/globalizable.rb @@ -110,10 +110,10 @@ module Globalizable end.join(", ") translations_ids = translation_class - .select("DISTINCT ON (#{translations_foreign_key}) id") - .where(locale: fallbacks) - .joins("LEFT JOIN (VALUES #{fallbacks_with_order}) AS locales(name, ordering) ON locale = locales.name") - .order(translations_foreign_key, "locales.ordering") + .select("DISTINCT ON (#{translations_foreign_key}) id") + .where(locale: fallbacks) + .joins("LEFT JOIN (VALUES #{fallbacks_with_order}) AS locales(name, ordering) ON locale = locales.name") + .order(translations_foreign_key, "locales.ordering") with_translations(fallbacks).where("#{translations_table_name}.id": translations_ids) end diff --git a/app/models/dashboard/action.rb b/app/models/dashboard/action.rb index a669990ce..6287adcab 100644 --- a/app/models/dashboard/action.rb +++ b/app/models/dashboard/action.rb @@ -108,9 +108,10 @@ class Dashboard::Action < ApplicationRecord end def self.calculate_actions(proposal_votes, day_offset, proposal) - Dashboard::Action.active.where("required_supports <= ?", proposal_votes) - .where("day_offset <= ?", day_offset) - .by_published_proposal(proposal.published?) + Dashboard::Action.active + .where("required_supports <= ?", proposal_votes) + .where("day_offset <= ?", day_offset) + .by_published_proposal(proposal.published?) end def self.calculate_votes(proposal, date) diff --git a/app/models/poll.rb b/app/models/poll.rb index c4eef8d39..3d14971fc 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -104,7 +104,7 @@ class Poll < ApplicationRecord return none if user.nil? || user.unverified? current.left_joins(:geozones) - .where("geozone_restricted = ? OR geozones.id = ?", false, user.geozone_id) + .where("geozone_restricted = ? OR geozones.id = ?", false, user.geozone_id) end def self.votable_by(user) diff --git a/app/models/poll/officer.rb b/app/models/poll/officer.rb index f43eb8d04..6c305476f 100644 --- a/app/models/poll/officer.rb +++ b/app/models/poll/officer.rb @@ -16,17 +16,19 @@ class Poll end def voting_days_assigned_polls - officer_assignments.voting_days.includes(booth_assignment: :poll) - .map(&:booth_assignment) - .map(&:poll).uniq.compact - .sort { |x, y| y.ends_at <=> x.ends_at } + officer_assignments.voting_days + .includes(booth_assignment: :poll) + .map(&:booth_assignment) + .map(&:poll).uniq.compact + .sort { |x, y| y.ends_at <=> x.ends_at } end def final_days_assigned_polls - officer_assignments.final.includes(booth_assignment: :poll) - .map(&:booth_assignment) - .map(&:poll).uniq.compact - .sort { |x, y| y.ends_at <=> x.ends_at } + officer_assignments.final + .includes(booth_assignment: :poll) + .map(&:booth_assignment) + .map(&:poll).uniq.compact + .sort { |x, y| y.ends_at <=> x.ends_at } end def todays_booths diff --git a/app/models/tag_cloud.rb b/app/models/tag_cloud.rb index c891e3f5d..f98f799e3 100644 --- a/app/models/tag_cloud.rb +++ b/app/models/tag_cloud.rb @@ -8,10 +8,10 @@ class TagCloud def tags resource_model_scoped - .last_week.send(counts) - .where("lower(name) NOT IN (?)", category_names + geozone_names + default_blacklist) - .order("#{table_name}_count": :desc, name: :asc) - .limit(10) + .last_week.send(counts) + .where("lower(name) NOT IN (?)", category_names + geozone_names + default_blacklist) + .order("#{table_name}_count": :desc, name: :asc) + .limit(10) end def counts diff --git a/app/models/verification/management/managed_user.rb b/app/models/verification/management/managed_user.rb index e4a44e63d..f4f0152f6 100644 --- a/app/models/verification/management/managed_user.rb +++ b/app/models/verification/management/managed_user.rb @@ -3,7 +3,7 @@ class Verification::Management::ManagedUser def self.find(document_type, document_number) User.where.not(document_number: nil) - .find_or_initialize_by(document_type: document_type, - document_number: document_number) + .find_or_initialize_by(document_type: document_type, + document_number: document_number) end end diff --git a/app/views/legislation/annotations/_comments.html.erb b/app/views/legislation/annotations/_comments.html.erb index 33375f40a..aad5a4248 100644 --- a/app/views/legislation/annotations/_comments.html.erb +++ b/app/views/legislation/annotations/_comments.html.erb @@ -1,5 +1,8 @@ -<% annotation.comments.roots.sort_by_most_voted - .limit(Legislation::Annotation::COMMENTS_PAGE_SIZE).each do |comment| %> +<% annotation.comments + .roots + .sort_by_most_voted + .limit(Legislation::Annotation::COMMENTS_PAGE_SIZE) + .each do |comment| %>

<%= truncate comment.body, length: 250 %>

diff --git a/spec/factories/sdg.rb b/spec/factories/sdg.rb index 1f933eb04..7a0b9efbd 100644 --- a/spec/factories/sdg.rb +++ b/spec/factories/sdg.rb @@ -22,7 +22,7 @@ FactoryBot.define do factory :sdg_review, class: "SDG::Review" do SDG::Related::RELATABLE_TYPES.map { |relatable_type| relatable_type.downcase.gsub("::", "_") } - .each do |relatable| + .each do |relatable| trait :"#{relatable}_review" do association :relatable, factory: relatable end diff --git a/spec/lib/remote_translations/caller_spec.rb b/spec/lib/remote_translations/caller_spec.rb index 8551096ef..76bc49695 100644 --- a/spec/lib/remote_translations/caller_spec.rb +++ b/spec/lib/remote_translations/caller_spec.rb @@ -221,7 +221,7 @@ describe RemoteTranslations::Caller, :remote_translations do fake_response = ["translated title", "translated description", "translated summary", nil] expect_any_instance_of(client).to receive(:call).with(field_values_sanitized, locale) - .and_return(fake_response) + .and_return(fake_response) caller.call end diff --git a/spec/lib/remote_translations/microsoft/client_spec.rb b/spec/lib/remote_translations/microsoft/client_spec.rb index 903a2ad21..0b9b4c731 100644 --- a/spec/lib/remote_translations/microsoft/client_spec.rb +++ b/spec/lib/remote_translations/microsoft/client_spec.rb @@ -62,13 +62,13 @@ describe RemoteTranslations::Microsoft::Client do response_end_text = [end_translated_text_es] expect_any_instance_of(BingTranslator).to receive(:translate_array).with([start_text_en], to: :es) - .exactly(1) - .times - .and_return(response_start_text) + .exactly(1) + .times + .and_return(response_start_text) expect_any_instance_of(BingTranslator).to receive(:translate_array).with([end_text_en], to: :es) - .exactly(1) - .times - .and_return(response_end_text) + .exactly(1) + .times + .and_return(response_end_text) start_another_text_en = Faker::Lorem.characters(number: 12) + "." end_another_text_en = Faker::Lorem.characters(number: 12) @@ -81,13 +81,13 @@ describe RemoteTranslations::Microsoft::Client do response_another_end_text = [another_end_translated_text_es] expect_any_instance_of(BingTranslator).to receive(:translate_array).with([start_another_text_en], to: :es) - .exactly(1) - .times - .and_return(response_another_start_text) + .exactly(1) + .times + .and_return(response_another_start_text) expect_any_instance_of(BingTranslator).to receive(:translate_array).with([end_another_text_en], to: :es) - .exactly(1) - .times - .and_return(response_another_end_text) + .exactly(1) + .times + .and_return(response_another_end_text) result = client.call([text_en, another_text_en], :es) diff --git a/spec/models/comment_spec.rb b/spec/models/comment_spec.rb index f98c86172..e5302665b 100644 --- a/spec/models/comment_spec.rb +++ b/spec/models/comment_spec.rb @@ -101,23 +101,23 @@ describe Comment do it "expires cache when the author is hidden" do expect { comment.user.hide } - .to change { [comment.reload.cache_version, comment.author.cache_version] } + .to change { [comment.reload.cache_version, comment.author.cache_version] } end it "expires cache when the author is erased" do expect { comment.user.erase } - .to change { [comment.reload.cache_version, comment.author.cache_version] } + .to change { [comment.reload.cache_version, comment.author.cache_version] } end it "expires cache when the author changes" do expect { comment.user.update(username: "Isabel") } - .to change { [comment.reload.cache_version, comment.author.cache_version] } + .to change { [comment.reload.cache_version, comment.author.cache_version] } end it "expires cache when the author's organization get verified" do create(:organization, user: comment.user) expect { comment.user.organization.verify } - .to change { [comment.reload.cache_version, comment.author.cache_version] } + .to change { [comment.reload.cache_version, comment.author.cache_version] } end end diff --git a/spec/models/debate_spec.rb b/spec/models/debate_spec.rb index 4b5564955..68270198d 100644 --- a/spec/models/debate_spec.rb +++ b/spec/models/debate_spec.rb @@ -376,23 +376,23 @@ describe Debate do it "expires cache when the author is hidden" do expect { debate.author.hide } - .to change { [debate.reload.cache_version, debate.author.cache_version] } + .to change { [debate.reload.cache_version, debate.author.cache_version] } end it "expires cache when the author is erased" do expect { debate.author.erase } - .to change { [debate.reload.cache_version, debate.author.cache_version] } + .to change { [debate.reload.cache_version, debate.author.cache_version] } end it "expires cache when its author changes" do expect { debate.author.update(username: "Eva") } - .to change { [debate.reload.cache_version, debate.author.cache_version] } + .to change { [debate.reload.cache_version, debate.author.cache_version] } end it "expires cache when the author's organization get verified" do create(:organization, user: debate.author) expect { debate.author.organization.verify } - .to change { [debate.reload.cache_version, debate.author.cache_version] } + .to change { [debate.reload.cache_version, debate.author.cache_version] } end end diff --git a/spec/models/legislation/process_spec.rb b/spec/models/legislation/process_spec.rb index 60e8e8236..dde6408b2 100644 --- a/spec/models/legislation/process_spec.rb +++ b/spec/models/legislation/process_spec.rb @@ -181,7 +181,7 @@ describe Legislation::Process do debate_end_date: Date.current - 1.day) expect(process).to be_invalid expect(process.errors.messages[:debate_end_date]) - .to include("must be on or after the debate start date") + .to include("must be on or after the debate start date") end it "is valid if draft_end_date is the same as draft_start_date" do @@ -195,7 +195,7 @@ describe Legislation::Process do draft_end_date: Date.current - 1.day) expect(process).to be_invalid expect(process.errors.messages[:draft_end_date]) - .to include("must be on or after the draft start date") + .to include("must be on or after the draft start date") end it "is invalid if allegations_end_date is before allegations_start_date" do @@ -203,7 +203,7 @@ describe Legislation::Process do allegations_end_date: Date.current - 1.day) expect(process).to be_invalid expect(process.errors.messages[:allegations_end_date]) - .to include("must be on or after the comments start date") + .to include("must be on or after the comments start date") end it "is valid if allegations_end_date is the same as allegations_start_date" do diff --git a/spec/models/local_census_records/import_spec.rb b/spec/models/local_census_records/import_spec.rb index b763c13c7..67a04cdf6 100644 --- a/spec/models/local_census_records/import_spec.rb +++ b/spec/models/local_census_records/import_spec.rb @@ -81,7 +81,7 @@ describe LocalCensusRecords::Import do expect(import.invalid_records.map(&:date_of_birth)) .to eq(invalid_records_date_of_births) expect(import.invalid_records.map(&:postal_code)) - .to eq(invalid_records_postal_codes) + .to eq(invalid_records_postal_codes) end end end diff --git a/spec/models/proposal_spec.rb b/spec/models/proposal_spec.rb index 48c5cf0ca..abb152549 100644 --- a/spec/models/proposal_spec.rb +++ b/spec/models/proposal_spec.rb @@ -427,23 +427,23 @@ describe Proposal do it "expires cache when the author is hidden" do expect { proposal.author.hide } - .to change { [proposal.reload.cache_version, proposal.author.cache_version] } + .to change { [proposal.reload.cache_version, proposal.author.cache_version] } end it "expires cache when the author is erased" do expect { proposal.author.erase } - .to change { [proposal.reload.cache_version, proposal.author.cache_version] } + .to change { [proposal.reload.cache_version, proposal.author.cache_version] } end it "expires cache when its author changes" do expect { proposal.author.update(username: "Eva") } - .to change { [proposal.reload.cache_version, proposal.author.cache_version] } + .to change { [proposal.reload.cache_version, proposal.author.cache_version] } end it "expires cache when the author's organization get verified" do create(:organization, user: proposal.author) expect { proposal.author.organization.verify } - .to change { [proposal.reload.cache_version, proposal.author.cache_version] } + .to change { [proposal.reload.cache_version, proposal.author.cache_version] } end end diff --git a/spec/shared/system/remotely_translatable.rb b/spec/shared/system/remotely_translatable.rb index 21e0c661e..87eb15533 100644 --- a/spec/shared/system/remotely_translatable.rb +++ b/spec/shared/system/remotely_translatable.rb @@ -10,8 +10,9 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume before do Setting["feature.remote_translations"] = true available_locales_response = %w[de en es fr pt zh-Hans] - expect(RemoteTranslations::Microsoft::AvailableLocales).to receive(:available_locales).at_most(4).times - .and_return(available_locales_response) + expect(RemoteTranslations::Microsoft::AvailableLocales) + .to receive(:available_locales).at_most(4).times + .and_return(available_locales_response) allow(Rails.application.secrets).to receive(:microsoft_api_key).and_return("123") end diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb index 95c3c4e47..ea415fa61 100644 --- a/spec/support/common_actions.rb +++ b/spec/support/common_actions.rb @@ -36,7 +36,7 @@ module CommonActions def validate_officer allow_any_instance_of(Officing::BaseController) - .to receive(:verify_officer_assignment).and_return(true) + .to receive(:verify_officer_assignment).and_return(true) end def fill_in_proposal @@ -70,7 +70,7 @@ module CommonActions booth = create(:poll_booth) if booth.blank? allow_any_instance_of(Officing::BaseController) - .to receive(:current_booth).and_return(booth) + .to receive(:current_booth).and_return(booth) end def click_sdg_goal(code) diff --git a/spec/system/admin/site_customization/information_texts_spec.rb b/spec/system/admin/site_customization/information_texts_spec.rb index c8855c09c..1c085bc67 100644 --- a/spec/system/admin/site_customization/information_texts_spec.rb +++ b/spec/system/admin/site_customization/information_texts_spec.rb @@ -56,7 +56,7 @@ describe "Admin custom information texts", :admin do within("#information-texts-tabs") { click_link "Proposals" } expect(find("a[href=\"/admin/site_customization/information_texts?tab=proposals\"].is-active")) - .to have_content "Proposals" + .to have_content "Proposals" end context "Globalization" do diff --git a/spec/system/budgets/votes_spec.rb b/spec/system/budgets/votes_spec.rb index 15c5d4caa..f180dbb98 100644 --- a/spec/system/budgets/votes_spec.rb +++ b/spec/system/budgets/votes_spec.rb @@ -149,7 +149,7 @@ describe "Votes" do participation = find(".participation-not-allowed") headings = participation.text - .match(/You have already supported investments in (.+) and (.+)\./)&.captures + .match(/You have already supported investments in (.+) and (.+)\./)&.captures expect(headings).to match_array [new_york.name, san_francisco.name] @@ -183,7 +183,7 @@ describe "Votes" do participation = find(".participation-not-allowed") headings = participation.text - .match(/You have already supported investments in (.+) and (.+)\./)&.captures + .match(/You have already supported investments in (.+) and (.+)\./)&.captures expect(headings).to match_array [new_york.name, san_francisco.name] diff --git a/spec/system/management/document_verifications_spec.rb b/spec/system/management/document_verifications_spec.rb index efb72664b..0549066cb 100644 --- a/spec/system/management/document_verifications_spec.rb +++ b/spec/system/management/document_verifications_spec.rb @@ -32,8 +32,9 @@ describe "DocumentVerifications" do describe "Verifying througth Census" do context "Census API" do scenario "Verifying a user which does not exist and is not in the census shows an error" do - expect_any_instance_of(Verification::Management::Document).to receive(:in_census?) - .and_return(false) + expect_any_instance_of(Verification::Management::Document) + .to receive(:in_census?) + .and_return(false) login_as_manager visit management_document_verifications_path @@ -55,8 +56,9 @@ describe "DocumentVerifications" do context "Remote Census API", :remote_census do scenario "Verifying a user which does not exist and is not in the census shows an error" do - expect_any_instance_of(Verification::Management::Document).to receive(:in_census?) - .and_return(false) + expect_any_instance_of(Verification::Management::Document) + .to receive(:in_census?) + .and_return(false) login_as_manager visit management_document_verifications_path