diff --git a/app/views/admin/legislation/questions/_form.html.erb b/app/views/admin/legislation/questions/_form.html.erb
index 22964c95a..beefabeb9 100644
--- a/app/views/admin/legislation/questions/_form.html.erb
+++ b/app/views/admin/legislation/questions/_form.html.erb
@@ -1,6 +1,6 @@
<%= render "shared/globalize_locales", resource: @question %>
-<%= translatable_form_for [:admin, @process, @question], url: url, html: {data: {watch_changes: true}} do |f| %>
+<%= translatable_form_for [:admin, @process, @question], url: url, html: { data: { watch_changes: true } } do |f| %>
<% if @question.errors.any? %>
diff --git a/app/views/admin/poll/booth_assignments/_booth_assignment.html.erb b/app/views/admin/poll/booth_assignments/_booth_assignment.html.erb
index 57cc8eaf0..13857144a 100644
--- a/app/views/admin/poll/booth_assignments/_booth_assignment.html.erb
+++ b/app/views/admin/poll/booth_assignments/_booth_assignment.html.erb
@@ -17,7 +17,7 @@
remote: true,
title: t("admin.booth_assignments.manage.actions.unassign"),
class: "button hollow alert expanded",
- data: (booth_assignment.shifts? ? {confirm: "#{t("admin.poll_booth_assignments.alert.shifts")}"} : nil) if !@poll.expired? %>
+ data: (booth_assignment.shifts? ? { confirm: "#{t("admin.poll_booth_assignments.alert.shifts")}" } : nil) if !@poll.expired? %>
<% else %>
diff --git a/app/views/admin/poll/officers/_officer.html.erb b/app/views/admin/poll/officers/_officer.html.erb
index 21a5bbdbc..70fc18ec1 100644
--- a/app/views/admin/poll/officers/_officer.html.erb
+++ b/app/views/admin/poll/officers/_officer.html.erb
@@ -21,7 +21,7 @@
method: :delete,
class: "button hollow alert expanded" %>
<% else %>
- <%= link_to t("admin.poll_officers.officer.add"),{ controller: "admin/poll/officers", action: :create, user_id: officer.user_id },
+ <%= link_to t("admin.poll_officers.officer.add"), { controller: "admin/poll/officers", action: :create, user_id: officer.user_id },
method: :post,
class: "button success expanded" %>
<% end %>
diff --git a/app/views/admin/poll/questions/_form.html.erb b/app/views/admin/poll/questions/_form.html.erb
index 350f25d75..67b3941c9 100644
--- a/app/views/admin/poll/questions/_form.html.erb
+++ b/app/views/admin/poll/questions/_form.html.erb
@@ -37,7 +37,7 @@
<%= fields_for :votation_type do |votation_f| %>
<%= votation_f.select :enum_type,
- options_for_select(VotationType.enum_types.map {|k, v| [t(k, scope: :enum_type), v]},
+ options_for_select(VotationType.enum_types.map { |k, v| [t(k, scope: :enum_type), v] },
params.dig(:votation_type, :enum_type)), default: 0,
disabled: @question.persisted?, label: t("enum_type.title") %>
@@ -53,8 +53,8 @@
<%= votation_f.select :prioritization_type,
- options_for_select(VotationType.prioritization_types.map {|k, v| [t(k, scope: :prioritization_type), v]},
- params.dig(:votation_type, :prioritization_type) ), default: 0,
+ options_for_select(VotationType.prioritization_types.map { |k, v| [t(k, scope: :prioritization_type), v] },
+ params.dig(:votation_type, :prioritization_type)), default: 0,
disabled: @question.persisted?, label: t("prioritization_type.title") %>
diff --git a/app/views/admin/poll/results/_results_by_booth.html.erb b/app/views/admin/poll/results/_results_by_booth.html.erb
index f270adaab..e91452bff 100644
--- a/app/views/admin/poll/results/_results_by_booth.html.erb
+++ b/app/views/admin/poll/results/_results_by_booth.html.erb
@@ -7,7 +7,7 @@
- <% @poll.booth_assignments.sort_by {|ba| ba.booth.name }.each do |booth_assignment| %>
+ <% @poll.booth_assignments.sort_by { |ba| ba.booth.name }.each do |booth_assignment| %>
| <%= booth_assignment.booth.name %> |
diff --git a/app/views/admin/poll/shifts/_form.html.erb b/app/views/admin/poll/shifts/_form.html.erb
index 0ea7cfb4a..726e0797f 100644
--- a/app/views/admin/poll/shifts/_form.html.erb
+++ b/app/views/admin/poll/shifts/_form.html.erb
@@ -15,7 +15,7 @@
<%= f.select :task,
- Poll::Shift.tasks.map {|k,v| [t("admin.poll_shifts.#{k}"), k]},
+ Poll::Shift.tasks.map { |k, v| [t("admin.poll_shifts.#{k}"), k] },
{ prompt: t("admin.poll_shifts.new.select_task"),
label: false },
class: "js-poll-shifts" %>
diff --git a/app/views/admin/settings/_featured_settings_form.html.erb b/app/views/admin/settings/_featured_settings_form.html.erb
index a0cd450f4..ea9c3732a 100644
--- a/app/views/admin/settings/_featured_settings_form.html.erb
+++ b/app/views/admin/settings/_featured_settings_form.html.erb
@@ -1,7 +1,7 @@
-<%= form_for(feature, url: admin_setting_path(feature), html: { id: "edit_#{dom_id(feature)}"}) do |f| %>
+<%= form_for(feature, url: admin_setting_path(feature), html: { id: "edit_#{dom_id(feature)}" }) do |f| %>
<%= f.hidden_field :tab, value: tab if defined?(tab) %>
<%= f.hidden_field :value, id: dom_id(feature), value: (feature.enabled? ? "" : "active") %>
<%= f.submit(t("admin.settings.index.features.#{feature.enabled? ? "disable" : "enable"}"),
class: "button expanded #{feature.enabled? ? "hollow alert" : "success"}",
- data: {confirm: t("admin.actions.confirm")}) %>
+ data: { confirm: t("admin.actions.confirm") }) %>
<% end %>
diff --git a/app/views/admin/settings/_settings_form.html.erb b/app/views/admin/settings/_settings_form.html.erb
index 83793788b..865c409f5 100644
--- a/app/views/admin/settings/_settings_form.html.erb
+++ b/app/views/admin/settings/_settings_form.html.erb
@@ -1,4 +1,4 @@
-<%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %>
+<%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}" }) do |f| %>
<%= f.hidden_field :tab, value: tab if defined?(tab) %>
<%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %>
diff --git a/app/views/admin/signature_sheets/new.html.erb b/app/views/admin/signature_sheets/new.html.erb
index cc889d68a..bf88f1ca7 100644
--- a/app/views/admin/signature_sheets/new.html.erb
+++ b/app/views/admin/signature_sheets/new.html.erb
@@ -17,7 +17,7 @@
<%= f.label :required_fields_to_verify %>
<%= required_fields_to_verify_text_help %>
<%= example_text_help %>
- <%= f.text_area :required_fields_to_verify, rows: "6", label: false, aria: {describedby: "required-fields-to-verify-help-text"} %>
+ <%= f.text_area :required_fields_to_verify, rows: "6", label: false, aria: { describedby: "required-fields-to-verify-help-text" } %>
<%= f.submit(class: "button", value: t("admin.signature_sheets.new.submit")) %>
<% end %>
diff --git a/app/views/admin/signature_sheets/show.html.erb b/app/views/admin/signature_sheets/show.html.erb
index 91fdc270a..1b235ae2c 100644
--- a/app/views/admin/signature_sheets/show.html.erb
+++ b/app/views/admin/signature_sheets/show.html.erb
@@ -21,7 +21,7 @@
<%= t("admin.signature_sheets.show.verified",
- count: @signature_sheet.signatures.verified.count ) %>
+ count: @signature_sheet.signatures.verified.count) %>
@@ -35,7 +35,7 @@
<%= t("admin.signature_sheets.show.unverified",
- count: @signature_sheet.signatures.unverified.count ) %>
+ count: @signature_sheet.signatures.unverified.count) %>
<%= t("admin.signature_sheets.show.unverified_error") %>
diff --git a/app/views/admin/site_customization/content_blocks/_form_content_block.html.erb b/app/views/admin/site_customization/content_blocks/_form_content_block.html.erb
index b54861dca..897558fe4 100644
--- a/app/views/admin/site_customization/content_blocks/_form_content_block.html.erb
+++ b/app/views/admin/site_customization/content_blocks/_form_content_block.html.erb
@@ -1,4 +1,4 @@
-<%= form_for [:admin, @content_block], html: {class: "edit_page", data: {watch_changes: true}} do |f| %>
+<%= form_for [:admin, @content_block], html: { class: "edit_page", data: { watch_changes: true } } do |f| %>
<% if @content_block.errors.any? %>
diff --git a/app/views/admin/site_customization/content_blocks/_form_heading_content_block.html.erb b/app/views/admin/site_customization/content_blocks/_form_heading_content_block.html.erb
index 2d14cd0c9..3f9e8e4b8 100644
--- a/app/views/admin/site_customization/content_blocks/_form_heading_content_block.html.erb
+++ b/app/views/admin/site_customization/content_blocks/_form_heading_content_block.html.erb
@@ -21,7 +21,7 @@
<%= label_tag :body %>
- <%= text_area_tag :body, @content_block.body, rows: 10 %>
+ <%= text_area_tag :body, @content_block.body, rows: 10 %>
<%= button_tag t("admin.menu.site_customization.buttons.content_block.update"), class: "button success expanded" %>
diff --git a/app/views/admin/site_customization/images/index.html.erb b/app/views/admin/site_customization/images/index.html.erb
index 8626751c5..f6ce49975 100644
--- a/app/views/admin/site_customization/images/index.html.erb
+++ b/app/views/admin/site_customization/images/index.html.erb
@@ -14,7 +14,7 @@
<%= image.name %> (<%= image.required_width %>x<%= image.required_height %>)
|
- <%= form_for([:admin, image], html: { id: "edit_#{dom_id(image)}"}) do |f| %>
+ <%= form_for([:admin, image], html: { id: "edit_#{dom_id(image)}" }) do |f| %>
<%= image_tag image.image.url if image.image.exists? %>
<%= f.file_field :image, label: false %>
diff --git a/app/views/admin/site_customization/pages/_form.html.erb b/app/views/admin/site_customization/pages/_form.html.erb
index 0411a5311..c253798d8 100644
--- a/app/views/admin/site_customization/pages/_form.html.erb
+++ b/app/views/admin/site_customization/pages/_form.html.erb
@@ -1,6 +1,6 @@
<%= render "shared/globalize_locales", resource: @page %>
-<%= translatable_form_for [:admin, @page], html: {class: "edit_page", data: {watch_changes: true}} do |f| %>
+<%= translatable_form_for [:admin, @page], html: { class: "edit_page", data: { watch_changes: true } } do |f| %>
<% if @page.errors.any? %>
|
<% end %>
- <%= paginate answers, params: {controller: "polls/questions", action: :load_answers, id: question}, remote: true %>
+ <%= paginate answers, params: { controller: "polls/questions", action: :load_answers, id: question }, remote: true %>
<%= render "/polls/questions/new_answer", question: question, token: token %>
diff --git a/app/views/proposals/_comments.html.erb b/app/views/proposals/_comments.html.erb
index 092ec8140..ffd5d5acb 100644
--- a/app/views/proposals/_comments.html.erb
+++ b/app/views/proposals/_comments.html.erb
@@ -4,7 +4,7 @@
<%= render "shared/wide_order_selector", i18n_namespace: "comments" %>
<% if user_signed_in? %>
- <%= render "comments/form", {commentable: @proposal, parent_id: nil, toggeable: false} %>
+ <%= render "comments/form", { commentable: @proposal, parent_id: nil, toggeable: false } %>
<% else %>
diff --git a/app/views/proposals/_featured_votes.html.erb b/app/views/proposals/_featured_votes.html.erb
index 01f05497c..a514f51fe 100644
--- a/app/views/proposals/_featured_votes.html.erb
+++ b/app/views/proposals/_featured_votes.html.erb
@@ -23,7 +23,7 @@
<%= t("votes.verified_only",
- verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %>
+ verify_account: link_to(t("votes.verify_account"), verification_path)).html_safe %>
<% elsif !user_signed_in? %>
diff --git a/app/views/proposals/_flag_actions.html.erb b/app/views/proposals/_flag_actions.html.erb
index 951fcfeef..ec012e3df 100644
--- a/app/views/proposals/_flag_actions.html.erb
+++ b/app/views/proposals/_flag_actions.html.erb
@@ -4,7 +4,7 @@
- <%= link_to t("shared.flag"), flag_proposal_path(proposal), method: :put, remote: true, id: "flag-proposal-#{ proposal.id }" %>
+ <%= link_to t("shared.flag"), flag_proposal_path(proposal), method: :put, remote: true, id: "flag-proposal-#{proposal.id}" %>
<% end %>
@@ -13,7 +13,7 @@
- <%= link_to t("shared.unflag"), unflag_proposal_path(proposal), method: :put, remote: true, id: "unflag-proposal-#{ proposal.id }" %>
+ <%= link_to t("shared.unflag"), unflag_proposal_path(proposal), method: :put, remote: true, id: "unflag-proposal-#{proposal.id}" %>
<% end %>
diff --git a/app/views/proposals/_form.html.erb b/app/views/proposals/_form.html.erb
index 92505e408..415536e85 100644
--- a/app/views/proposals/_form.html.erb
+++ b/app/views/proposals/_form.html.erb
@@ -25,7 +25,7 @@
rows: 4, maxlength: 200,
label: false,
placeholder: t("proposals.form.proposal_summary"),
- aria: {describedby: summary_help_text_id(translations_form)} %>
+ aria: { describedby: summary_help_text_id(translations_form) } %>
@@ -42,7 +42,7 @@
<%= t("proposals.form.proposal_video_url_note") %>
<%= f.text_field :video_url, placeholder: t("proposals.form.proposal_video_url"),
label: false,
- aria: {describedby: "video-url-help-text"} %>
+ aria: { describedby: "video-url-help-text" } %>
<% if feature?(:allow_images) %>
@@ -59,7 +59,7 @@
<%= f.label :geozone_id, t("proposals.form.geozone") %>
- <%= f.select :geozone_id, geozone_select_options, {include_blank: t("geozones.none"), label: false} %>
+ <%= f.select :geozone_id, geozone_select_options, { include_blank: t("geozones.none"), label: false } %>
<% if feature?(:map) %>
@@ -93,8 +93,8 @@
label: false,
placeholder: t("proposals.form.tags_placeholder"),
class: "js-tag-list tag-autocomplete",
- aria: {describedby: "tag-list-help-text"},
- data: {js_url: suggest_tags_path} %>
+ aria: { describedby: "tag-list-help-text" },
+ data: { js_url: suggest_tags_path } %>
<% if current_user.unverified? %>
@@ -102,7 +102,7 @@
<%= f.label :responsible_name, t("proposals.form.proposal_responsible_name") %>
<%= t("proposals.form.proposal_responsible_name_note") %>
<%= f.text_field :responsible_name, placeholder: t("proposals.form.proposal_responsible_name"), label: false,
- aria: {describedby: "responsible-name-help-text"} %>
+ aria: { describedby: "responsible-name-help-text" } %>
<% end %>
diff --git a/app/views/proposals/_votes.html.erb b/app/views/proposals/_votes.html.erb
index 448c9d7a3..399dacd15 100644
--- a/app/views/proposals/_votes.html.erb
+++ b/app/views/proposals/_votes.html.erb
@@ -30,7 +30,7 @@
<%= t("votes.verified_only",
- verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %>
+ verify_account: link_to(t("votes.verify_account"), verification_path)).html_safe %>
diff --git a/app/views/proposals/retire_form.html.erb b/app/views/proposals/retire_form.html.erb
index 604cd1a47..9de4bd3ba 100644
--- a/app/views/proposals/retire_form.html.erb
+++ b/app/views/proposals/retire_form.html.erb
@@ -17,7 +17,7 @@
<%= f.label :retired_reason, t("proposals.retire_form.retired_reason_label") %>
- <%= f.select :retired_reason, retire_proposals_options, {include_blank: t("proposals.retire_form.retired_reason_blank"), label: false} %>
+ <%= f.select :retired_reason, retire_proposals_options, { include_blank: t("proposals.retire_form.retired_reason_blank"), label: false } %>
diff --git a/app/views/relationable/_score.html.erb b/app/views/relationable/_score.html.erb
index 42d00639f..be481fdae 100644
--- a/app/views/relationable/_score.html.erb
+++ b/app/views/relationable/_score.html.erb
@@ -5,13 +5,13 @@
score_positive_related_content_path(related),
method: :put,
remote: true,
- id: "score-positive-related-#{ related.id }",
+ id: "score-positive-related-#{related.id}",
class: "score-positive" %>
<%= link_to t("related_content.score_negative"),
score_negative_related_content_path(related),
method: :put,
remote: true,
- id: "score-negative-related-#{ related.id }",
+ id: "score-negative-related-#{related.id}",
class: "score-negative" %>
diff --git a/app/views/shared/_map.html.erb b/app/views/shared/_map.html.erb
index 9aeaf4da5..499b1e47e 100644
--- a/app/views/shared/_map.html.erb
+++ b/app/views/shared/_map.html.erb
@@ -29,11 +29,11 @@
<%= t("map.proposal_for_district") %>
- <%= form_for(@resource, url: new_url_path, method: :get ) do |f| %>
+ <%= form_for(@resource, url: new_url_path, method: :get) do |f| %>
<%= f.label :geozone_id, t("map.select_district") %>
<%= f.select :geozone_id, geozone_select_options,
- {include_blank: t("geozones.none"), label: false} %>
+ { include_blank: t("geozones.none"), label: false } %>
diff --git a/app/views/topics/_comments.html.erb b/app/views/topics/_comments.html.erb
index bf8e20d0a..b2ee11d99 100644
--- a/app/views/topics/_comments.html.erb
+++ b/app/views/topics/_comments.html.erb
@@ -11,7 +11,7 @@
<%= paginate @comment_tree.root_comments %>
<% if user_signed_in? %>
- <%= render "comments/form", {commentable: @topic, parent_id: nil, toggeable: false} %>
+ <%= render "comments/form", { commentable: @topic, parent_id: nil, toggeable: false } %>
<% else %>
diff --git a/app/views/users/_budget_investment.html.erb b/app/views/users/_budget_investment.html.erb
index 7c2ae2cd5..5ce114cb3 100644
--- a/app/views/users/_budget_investment.html.erb
+++ b/app/views/users/_budget_investment.html.erb
@@ -6,7 +6,7 @@
<% if can? :destroy, budget_investment %>
<%= link_to t("shared.delete"), budget_investment_path(budget_investment.budget, budget_investment),
method: :delete, class: "button hollow alert expanded",
- data: {confirm: "#{t("users.show.delete_alert")}"} %>
+ data: { confirm: "#{t("users.show.delete_alert")}" } %>
<% end %>
diff --git a/app/views/users/registrations/edit.html.erb b/app/views/users/registrations/edit.html.erb
index b02fbda8f..c4abc987d 100644
--- a/app/views/users/registrations/edit.html.erb
+++ b/app/views/users/registrations/edit.html.erb
@@ -21,7 +21,7 @@
<%= t("devise_views.users.registrations.edit.leave_blank") %>
<%= f.password_field :password, autocomplete: "off", label: false,
placeholder: t("devise_views.users.registrations.edit.password_label"),
- aria: {describedby: "password-help-text"} %>
+ aria: { describedby: "password-help-text" } %>
@@ -34,7 +34,7 @@
<%= t("devise_views.users.registrations.edit.need_current") %>
<%= f.password_field :current_password, label: false, autocomplete: "off",
placeholder: t("devise_views.users.registrations.edit.current_password_label"),
- aria: {describedby: "current-password-help-text"} %>
+ aria: { describedby: "current-password-help-text" } %>
diff --git a/app/views/users/registrations/finish_signup.html.erb b/app/views/users/registrations/finish_signup.html.erb
index ecee7183e..264372e32 100644
--- a/app/views/users/registrations/finish_signup.html.erb
+++ b/app/views/users/registrations/finish_signup.html.erb
@@ -1,6 +1,6 @@
<%= t("omniauth.finish_signup.title") %>
-<%= form_for current_user, as: :user, url: do_finish_signup_path, html: { role: "form"} do |f| %>
+<%= form_for current_user, as: :user, url: do_finish_signup_path, html: { role: "form" } do |f| %>
<%= render "shared/errors", resource: current_user %>
diff --git a/app/views/users/registrations/new.html.erb b/app/views/users/registrations/new.html.erb
index f5c8cbecb..9d3336178 100644
--- a/app/views/users/registrations/new.html.erb
+++ b/app/views/users/registrations/new.html.erb
@@ -22,7 +22,7 @@
<%= f.text_field :username, autofocus: true, maxlength: User.username_max_length,
placeholder: t("devise_views.users.registrations.new.username_label"),
label: false,
- aria: {describedby: "username-help-text"} %>
+ aria: { describedby: "username-help-text" } %>
<%= f.invisible_captcha :address %>
diff --git a/app/views/valuation/budget_investments/_dossier_form.html.erb b/app/views/valuation/budget_investments/_dossier_form.html.erb
index 776bb6e23..469fce699 100644
--- a/app/views/valuation/budget_investments/_dossier_form.html.erb
+++ b/app/views/valuation/budget_investments/_dossier_form.html.erb
@@ -1,5 +1,5 @@
<% budget = investment.budget %>
-<%= form_for(investment, url: valuate_valuation_budget_budget_investment_path(budget, investment), html: {id: "valuation_budget_investment_edit_form"}) do |f| %>
+<%= form_for(investment, url: valuate_valuation_budget_budget_investment_path(budget, investment), html: { id: "valuation_budget_investment_edit_form" }) do |f| %>
<%= render "shared/errors", resource: investment %>
diff --git a/app/views/verification/letter/edit.html.erb b/app/views/verification/letter/edit.html.erb
index 8a53ea253..d9b99bec4 100644
--- a/app/views/verification/letter/edit.html.erb
+++ b/app/views/verification/letter/edit.html.erb
@@ -1,5 +1,5 @@
- <% track_event(category: "verification", action: "edit_letter" ) %>
+ <% track_event(category: "verification", action: "edit_letter") %>
diff --git a/app/views/verification/letter/new.html.erb b/app/views/verification/letter/new.html.erb
index 62939c032..b7a442f99 100644
--- a/app/views/verification/letter/new.html.erb
+++ b/app/views/verification/letter/new.html.erb
@@ -1,5 +1,5 @@
- <% track_event(category: "verification", action: "success_sms" ) %>
+ <% track_event(category: "verification", action: "success_sms") %>
diff --git a/app/views/verification/letter/show.html.erb b/app/views/verification/letter/show.html.erb
index 012f56c8c..8fdc94075 100644
--- a/app/views/verification/letter/show.html.erb
+++ b/app/views/verification/letter/show.html.erb
@@ -1,5 +1,5 @@
- <% track_event(category: "verification", action: "start_letter" ) %>
+ <% track_event(category: "verification", action: "start_letter") %>
<%= back_link_to account_path, t("verification.back") %>
diff --git a/app/views/verification/residence/new.html.erb b/app/views/verification/residence/new.html.erb
index 94933084d..b95523a75 100644
--- a/app/views/verification/residence/new.html.erb
+++ b/app/views/verification/residence/new.html.erb
@@ -1,5 +1,5 @@
- <% track_event(category: "verification", action: "start_census" ) %>
+ <% track_event(category: "verification", action: "start_census") %>
@@ -75,7 +75,7 @@
<%= f.label t("verification.residence.new.postal_code") %>
<%= t("verification.residence.new.postal_code_note") %>
- <%= f.text_field :postal_code, label: false, aria: {describedby: "postal-code-help-text"} %>
+ <%= f.text_field :postal_code, label: false, aria: { describedby: "postal-code-help-text" } %>
diff --git a/app/views/verification/sms/edit.html.erb b/app/views/verification/sms/edit.html.erb
index a53d0495a..51189f2bc 100644
--- a/app/views/verification/sms/edit.html.erb
+++ b/app/views/verification/sms/edit.html.erb
@@ -1,5 +1,5 @@
- <% track_event(category: "verification", action: "start_sms" ) %>
+ <% track_event(category: "verification", action: "start_sms") %>
diff --git a/app/views/verification/sms/new.html.erb b/app/views/verification/sms/new.html.erb
index 004eb000b..b69bef710 100644
--- a/app/views/verification/sms/new.html.erb
+++ b/app/views/verification/sms/new.html.erb
@@ -1,5 +1,5 @@
- <% track_event(category: "verification", action: "success_census" ) %>
+ <% track_event(category: "verification", action: "success_census") %>
@@ -31,7 +31,7 @@
<%= t("verification.sms.new.phone_note") %>
<%= f.text_field :phone, label: false,
placeholder: t("verification.sms.new.phone_placeholder"),
- aria: {describedby: "phone-help-text"} %>
+ aria: { describedby: "phone-help-text" } %>
<%= f.submit t("verification.sms.new.submit_button"), class: "button success" %>
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 2972eb78f..6c23b8ab5 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -56,7 +56,7 @@ Rails.application.configure do
config.log_level = :warn
# Prepend all log lines with the following tags.
- config.log_tags = [ :request_id ]
+ config.log_tags = [:request_id]
# Use a different cache store in production.
config.cache_store = :dalli_store, { value_max_bytes: 2000000 }
diff --git a/config/initializers/acts_as_taggable_on.rb b/config/initializers/acts_as_taggable_on.rb
index 23696c1af..c8ebc9f6e 100644
--- a/config/initializers/acts_as_taggable_on.rb
+++ b/config/initializers/acts_as_taggable_on.rb
@@ -47,7 +47,7 @@ module ActsAsTaggableOn
pg_search_scope :pg_search, against: :name,
using: {
- tsearch: {prefix: true}
+ tsearch: { prefix: true }
},
ignoring: :accents
diff --git a/config/initializers/ckeditor.rb b/config/initializers/ckeditor.rb
index 9710c59ae..fbe6f485b 100644
--- a/config/initializers/ckeditor.rb
+++ b/config/initializers/ckeditor.rb
@@ -7,6 +7,6 @@ Ckeditor.setup do |config|
config.authorize_with :cancan
- config.assets_languages = Rails.application.config.i18n.available_locales.map{|l| l.to_s.downcase}
+ config.assets_languages = Rails.application.config.i18n.available_locales.map { |l| l.to_s.downcase }
config.assets_plugins = %w[copyformatting image link magicline scayt table tableselection wsc]
end
diff --git a/db/dev_seeds/budgets.rb b/db/dev_seeds/budgets.rb
index f131eba5f..360c38298 100644
--- a/db/dev_seeds/budgets.rb
+++ b/db/dev_seeds/budgets.rb
@@ -159,8 +159,8 @@ end
section "Geolocating Investments" do
Budget.find_each do |budget|
budget.investments.each do |investment|
- MapLocation.create(latitude: Setting["map.latitude"].to_f + rand(-10..10)/100.to_f,
- longitude: Setting["map.longitude"].to_f + rand(-10..10)/100.to_f,
+ MapLocation.create(latitude: Setting["map.latitude"].to_f + rand(-10..10) / 100.to_f,
+ longitude: Setting["map.longitude"].to_f + rand(-10..10) / 100.to_f,
zoom: Setting["map.zoom"],
investment_id: investment.id)
end
diff --git a/lib/census_api.rb b/lib/census_api.rb
index d010c66db..e5b1896aa 100644
--- a/lib/census_api.rb
+++ b/lib/census_api.rb
@@ -116,7 +116,7 @@ class CensusApi
end
def stubbed_invalid_response
- {get_habita_datos_response: {get_habita_datos_return: {datos_habitante: {}, datos_vivienda: {}}}}
+ { get_habita_datos_response: { get_habita_datos_return: { datos_habitante: {}, datos_vivienda: {}}}}
end
end
diff --git a/lib/graph_ql/query_type_creator.rb b/lib/graph_ql/query_type_creator.rb
index d0c216bcf..159e859ab 100644
--- a/lib/graph_ql/query_type_creator.rb
+++ b/lib/graph_ql/query_type_creator.rb
@@ -14,7 +14,7 @@ module GraphQL
type created_type
description model.graphql_field_description
argument :id, !types.ID
- resolve ->(object, arguments, context) { model.public_for_api.find_by(id: arguments["id"])}
+ resolve ->(object, arguments, context) { model.public_for_api.find_by(id: arguments["id"]) }
end
end
diff --git a/lib/manager_authenticator.rb b/lib/manager_authenticator.rb
index 8f9a1f55a..8d8de2396 100644
--- a/lib/manager_authenticator.rb
+++ b/lib/manager_authenticator.rb
@@ -1,11 +1,11 @@
class ManagerAuthenticator
def initialize(data = {})
- @manager = {login: data[:login], user_key: data[:clave_usuario], date: data[:fecha_conexion]}.with_indifferent_access
+ @manager = { login: data[:login], user_key: data[:clave_usuario], date: data[:fecha_conexion] }.with_indifferent_access
end
def auth
- return false unless [@manager[:login], @manager[:user_key], @manager[:date]].all? {|manager| manager.present?}
+ return false unless [@manager[:login], @manager[:user_key], @manager[:date]].all? { |manager| manager.present? }
return @manager if manager_exists? && application_authorized?
false
end
@@ -13,7 +13,7 @@ class ManagerAuthenticator
private
def manager_exists?
- response = client.call(:get_status_user_data, message: { ub: {user_key: @manager[:user_key], date: @manager[:date]} }).body
+ response = client.call(:get_status_user_data, message: { ub: { user_key: @manager[:user_key], date: @manager[:date] }}).body
parsed_response = parser.parse((response[:get_status_user_data_response][:get_status_user_data_return]))
@manager[:login] == parsed_response["USUARIO"]["LOGIN"]
rescue
@@ -21,7 +21,7 @@ class ManagerAuthenticator
end
def application_authorized?
- response = client.call(:get_applications_user_list, message: { ub: {user_key: @manager[:user_key]} }).body
+ response = client.call(:get_applications_user_list, message: { ub: { user_key: @manager[:user_key] }}).body
parsed_response = parser.parse((response[:get_applications_user_list_response][:get_applications_user_list_return]))
aplication_value = parsed_response["APLICACIONES"]["APLICACION"]
# aplication_value from UWEB can be an array of hashes or a hash
diff --git a/lib/remote_census_api.rb b/lib/remote_census_api.rb
index ae2c1c4ad..9843aabc7 100644
--- a/lib/remote_census_api.rb
+++ b/lib/remote_census_api.rb
@@ -64,7 +64,7 @@ class RemoteCensusApi
end
def parse_path(path_value)
- path_value.split(".").map{ |section| section.to_sym } if path_value.present?
+ path_value.split(".").map { |section| section.to_sym } if path_value.present?
end
end
@@ -105,7 +105,7 @@ class RemoteCensusApi
end
def parse_path(path_value)
- path_value.split(".").map{ |section| section.to_sym } if path_value.present?
+ path_value.split(".").map { |section| section.to_sym } if path_value.present?
end
def update_value(structure, path, value)
@@ -153,7 +153,7 @@ class RemoteCensusApi
end
def stubbed_invalid_response
- {get_habita_datos_response: {get_habita_datos_return: {datos_habitante: {}, datos_vivienda: {}}}}
+ { get_habita_datos_response: { get_habita_datos_return: { datos_habitante: {}, datos_vivienda: {}}}}
end
end
diff --git a/lib/remote_translations/microsoft/client.rb b/lib/remote_translations/microsoft/client.rb
index 31087b2fa..f3bd2295b 100644
--- a/lib/remote_translations/microsoft/client.rb
+++ b/lib/remote_translations/microsoft/client.rb
@@ -21,7 +21,7 @@ class RemoteTranslations::Microsoft::Client
split_position = detect_split_position(text)
start_text = text[0..split_position]
- end_text = text[split_position + 1 .. text.size]
+ end_text = text[split_position + 1..text.size]
fragments_for(start_text) + [end_text]
end
diff --git a/lib/score_calculator.rb b/lib/score_calculator.rb
index 44a831f73..52a5c0116 100644
--- a/lib/score_calculator.rb
+++ b/lib/score_calculator.rb
@@ -6,7 +6,7 @@ module ScoreCalculator
period = [1, [max_period, resource_age(resource)].min].max
votes_total = resource.votes_for.where("created_at >= ?", period.days.ago).count
- votes_up = resource.get_upvotes.where("created_at >= ?", period.days.ago).count
+ votes_up = resource.get_upvotes.where("created_at >= ?", period.days.ago).count
votes_down = votes_total - votes_up
votes_score = votes_up - votes_down
diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb
index 025ec4e39..74ad688e0 100644
--- a/spec/controllers/application_controller_spec.rb
+++ b/spec/controllers/application_controller_spec.rb
@@ -10,7 +10,7 @@ describe ApplicationController do
current_budget = create(:budget, phase: "accepting", created_at: 1.month.ago)
next_budget = create(:budget, phase: "drafting", created_at: 1.week.ago)
- budget = subject.instance_eval{ current_budget }
+ budget = subject.instance_eval { current_budget }
expect(budget).to eq(current_budget)
end
diff --git a/spec/controllers/legislation/annotations_controller_spec.rb b/spec/controllers/legislation/annotations_controller_spec.rb
index 148c4451c..4924ad989 100644
--- a/spec/controllers/legislation/annotations_controller_spec.rb
+++ b/spec/controllers/legislation/annotations_controller_spec.rb
@@ -91,13 +91,13 @@ describe Legislation::AnnotationsController do
draft_version_id: draft_version.id,
legislation_annotation: {
"quote" => "ipsum",
- "ranges"=> [{
+ "ranges" => [{
"start" => "/p[1]",
"startOffset" => 6,
"end" => "/p[1]",
"endOffset" => 11
}],
- "text" => "una anotacion"
+ "text" => "una anotacion"
}
}
end.not_to change { draft_version.annotations.count }
diff --git a/spec/controllers/management/sessions_controller_spec.rb b/spec/controllers/management/sessions_controller_spec.rb
index 2d58b0202..daf4441b1 100644
--- a/spec/controllers/management/sessions_controller_spec.rb
+++ b/spec/controllers/management/sessions_controller_spec.rb
@@ -14,11 +14,11 @@ describe Management::SessionsController do
end
it "redirects to management root path if authorized manager with right credentials" do
- manager = {login: "JJB033", user_key: "31415926", date: "20151031135905"}
+ manager = { login: "JJB033", user_key: "31415926", date: "20151031135905" }
allow_any_instance_of(ManagerAuthenticator).to receive(:auth).and_return(manager)
get :create, params: {
- login: "JJB033" ,
+ login: "JJB033",
clave_usuario: "31415926",
fecha_conexion: "20151031135905"
}
@@ -54,7 +54,7 @@ describe Management::SessionsController do
describe "Sign out" do
it "destroys the session data and redirect" do
- session[:manager] = {user_key: "31415926", date: "20151031135905", login: "JJB033"}
+ session[:manager] = { user_key: "31415926", date: "20151031135905", login: "JJB033" }
session[:document_type] = "1"
session[:document_number] = "12345678Z"
diff --git a/spec/controllers/management/users_controller_spec.rb b/spec/controllers/management/users_controller_spec.rb
index 60cc81700..ac8df0652 100644
--- a/spec/controllers/management/users_controller_spec.rb
+++ b/spec/controllers/management/users_controller_spec.rb
@@ -4,7 +4,7 @@ describe Management::UsersController do
describe "logout" do
it "removes user data from the session" do
- session[:manager] = {user_key: "31415926", date: "20151031135905", login: "JJB033"}
+ session[:manager] = { user_key: "31415926", date: "20151031135905", login: "JJB033" }
session[:document_type] = "1"
session[:document_number] = "12345678Z"
diff --git a/spec/factories/administration.rb b/spec/factories/administration.rb
index e11b73ac2..7fed42216 100644
--- a/spec/factories/administration.rb
+++ b/spec/factories/administration.rb
@@ -17,7 +17,7 @@ FactoryBot.define do
factory :banner do
sequence(:title) { |n| "Banner title #{n}" }
sequence(:description) { |n| "This is the text of Banner #{n}" }
- target_url {["/proposals", "/debates" ].sample}
+ target_url { ["/proposals", "/debates"].sample }
post_started_at { Time.current - 7.days }
post_ended_at { Time.current + 7.days }
background_color { "#FF0000" }
diff --git a/spec/factories/analytics.rb b/spec/factories/analytics.rb
index 59b0b52ff..c5cbeb11e 100644
--- a/spec/factories/analytics.rb
+++ b/spec/factories/analytics.rb
@@ -2,7 +2,7 @@ FactoryBot.define do
factory :ahoy_event, class: Ahoy::Event do
id { SecureRandom.uuid }
time { DateTime.current }
- sequence(:name) {|n| "Event #{n} type"}
+ sequence(:name) { |n| "Event #{n} type" }
end
factory :visit do
diff --git a/spec/factories/legislations.rb b/spec/factories/legislations.rb
index e25e5086d..0da50299a 100644
--- a/spec/factories/legislations.rb
+++ b/spec/factories/legislations.rb
@@ -152,7 +152,7 @@ LOREM_IPSUM
author factory: :user
quote { "ipsum" }
text { "a comment" }
- ranges { [{"start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11}] }
+ ranges { [{ "start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11 }] }
range_start { "/p[1]" }
range_start_offset { 6 }
range_end { "/p[1]" }
diff --git a/spec/features/admin/budget_investments_spec.rb b/spec/features/admin/budget_investments_spec.rb
index a0fb805f6..b0686a9d4 100644
--- a/spec/features/admin/budget_investments_spec.rb
+++ b/spec/features/admin/budget_investments_spec.rb
@@ -33,7 +33,7 @@ describe "Admin budget investments" do
end
scenario "Disabled with a feature flag" do
- expect{ visit admin_budgets_path }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect { visit admin_budgets_path }.to raise_exception(FeatureFlags::FeatureDisabled)
end
end
@@ -503,7 +503,7 @@ describe "Admin budget investments" do
valuating.valuators.push(create(:valuator))
valuated.valuators.push(create(:valuator))
- query_params = {budget_id: budget.id, advanced_filters: ["under_valuation"]}
+ query_params = { budget_id: budget.id, advanced_filters: ["under_valuation"] }
visit admin_budget_budget_investments_path(query_params)
@@ -1822,7 +1822,7 @@ describe "Admin budget investments" do
visit admin_budget_budget_investments_path(budget)
cookies = page.driver.browser.manage.all_cookies
- cookie = cookies.find{|cookie| cookie[:name] == "investments-columns"}
+ cookie = cookies.find { |cookie| cookie[:name] == "investments-columns" }
cookie_value = cookie[:value]
expect(cookie_value).to eq("id,title,supports,admin,valuator,geozone," +
@@ -1876,7 +1876,7 @@ describe "Admin budget investments" do
end
cookies = page.driver.browser.manage.all_cookies
- cookie = cookies.find{|cookie| cookie[:name] == "investments-columns"}
+ cookie = cookies.find { |cookie| cookie[:name] == "investments-columns" }
cookie_value = cookie[:value]
expect(cookie_value).to eq("id,supports,admin,geozone," +
@@ -1885,7 +1885,7 @@ describe "Admin budget investments" do
visit admin_budget_budget_investments_path(budget)
cookies = page.driver.browser.manage.all_cookies
- cookie = cookies.find{|cookie| cookie[:name] == "investments-columns"}
+ cookie = cookies.find { |cookie| cookie[:name] == "investments-columns" }
cookie_value = cookie[:value]
expect(cookie_value).to eq("id,supports,admin,geozone,feasibility,valuation_finished," +
diff --git a/spec/features/admin/budgets_spec.rb b/spec/features/admin/budgets_spec.rb
index 80f36b0b1..6db5f4c7f 100644
--- a/spec/features/admin/budgets_spec.rb
+++ b/spec/features/admin/budgets_spec.rb
@@ -19,7 +19,7 @@ describe "Admin budgets" do
end
scenario "Disabled with a feature flag" do
- expect{ visit admin_budgets_path }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect { visit admin_budgets_path }.to raise_exception(FeatureFlags::FeatureDisabled)
end
end
@@ -93,7 +93,7 @@ describe "Admin budgets" do
end
scenario "Open filter is properly highlighted" do
- filters_links = {"current" => "Open", "finished" => "Finished"}
+ filters_links = { "current" => "Open", "finished" => "Finished" }
visit admin_budgets_path
diff --git a/spec/features/admin/change_log_spec.rb b/spec/features/admin/change_log_spec.rb
index 684d94038..2584971f4 100644
--- a/spec/features/admin/change_log_spec.rb
+++ b/spec/features/admin/change_log_spec.rb
@@ -1,7 +1,7 @@
require "rails_helper"
describe "Admin change log" do
- let(:budget) {create(:budget)}
+ let(:budget) { create(:budget) }
let(:administrator) do
create(:administrator, user: create(:user, username: "Ana", email: "ana@admins.org"))
end
diff --git a/spec/features/admin/dashboard/actions_spec.rb b/spec/features/admin/dashboard/actions_spec.rb
index 652d2c9f6..e49bb4481 100644
--- a/spec/features/admin/dashboard/actions_spec.rb
+++ b/spec/features/admin/dashboard/actions_spec.rb
@@ -11,7 +11,7 @@ describe "Admin dashboard actions" do
"administrator",
"dashboard_action",
"new_admin_dashboard_action_path",
- { },
+ {},
"documentable_fill_new_valid_dashboard_action",
"Save",
"Action created successfully"
diff --git a/spec/features/admin/debates_spec.rb b/spec/features/admin/debates_spec.rb
index 783edf6b8..0b9252817 100644
--- a/spec/features/admin/debates_spec.rb
+++ b/spec/features/admin/debates_spec.rb
@@ -7,7 +7,7 @@ describe "Admin debates" do
admin = create(:administrator)
login_as(admin.user)
- expect{ visit admin_hidden_debates_path }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect { visit admin_hidden_debates_path }.to raise_exception(FeatureFlags::FeatureDisabled)
Setting["process.debates"] = true
end
diff --git a/spec/features/admin/download_settings_spec.rb b/spec/features/admin/download_settings_spec.rb
index 28cffa683..6ab948824 100644
--- a/spec/features/admin/download_settings_spec.rb
+++ b/spec/features/admin/download_settings_spec.rb
@@ -284,7 +284,7 @@ describe "Admin download settings" do
heading: heading,
price: 600,
ballot_lines_count: 600) }
- let(:budget) {create :budget}
+ let(:budget) { create :budget }
before do
Budget::Result.new(budget_finished, heading).calculate_winners
diff --git a/spec/features/admin/emails/newsletters_spec.rb b/spec/features/admin/emails/newsletters_spec.rb
index 0278738da..0cdfab879 100644
--- a/spec/features/admin/emails/newsletters_spec.rb
+++ b/spec/features/admin/emails/newsletters_spec.rb
@@ -66,7 +66,7 @@ describe "Admin newsletter emails" do
fill_in_newsletter_form(subject: "This is a subject",
segment_recipient: "Proposal authors",
- body: "This is a body" )
+ body: "This is a body")
click_button "Create Newsletter"
expect(page).to have_content "Newsletter created successfully"
@@ -86,7 +86,7 @@ describe "Admin newsletter emails" do
fill_in_newsletter_form(subject: "This is a subject",
segment_recipient: "Investment authors in the current budget",
- body: "This is a body" )
+ body: "This is a body")
click_button "Update Newsletter"
expect(page).to have_content "Newsletter updated successfully"
diff --git a/spec/features/admin/feature_flags_spec.rb b/spec/features/admin/feature_flags_spec.rb
index a4449ab39..6fbc6c758 100644
--- a/spec/features/admin/feature_flags_spec.rb
+++ b/spec/features/admin/feature_flags_spec.rb
@@ -35,8 +35,8 @@ describe "Admin feature flags" do
expect(page).not_to have_link "Participatory budgets"
end
- expect{ visit budget_path(budget) }.to raise_exception(FeatureFlags::FeatureDisabled)
- expect{ visit admin_budgets_path }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect { visit budget_path(budget) }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect { visit admin_budgets_path }.to raise_exception(FeatureFlags::FeatureDisabled)
end
scenario "Enable a disabled participatory process" do
diff --git a/spec/features/admin/hidden_budget_investments_spec.rb b/spec/features/admin/hidden_budget_investments_spec.rb
index 451ff48e3..924475cd9 100644
--- a/spec/features/admin/hidden_budget_investments_spec.rb
+++ b/spec/features/admin/hidden_budget_investments_spec.rb
@@ -14,7 +14,7 @@ describe "Admin hidden budget investments" do
scenario "Disabled with a feature flag" do
Setting["process.budgets"] = nil
- expect{ visit admin_hidden_budget_investments_path }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect { visit admin_hidden_budget_investments_path }.to raise_exception(FeatureFlags::FeatureDisabled)
end
scenario "List shows all relevant info" do
diff --git a/spec/features/admin/hidden_proposals_spec.rb b/spec/features/admin/hidden_proposals_spec.rb
index c7a7a3d24..6635b2614 100644
--- a/spec/features/admin/hidden_proposals_spec.rb
+++ b/spec/features/admin/hidden_proposals_spec.rb
@@ -12,7 +12,7 @@ describe "Admin hidden proposals" do
admin = create(:administrator)
login_as(admin.user)
- expect{ visit admin_hidden_proposals_path }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect { visit admin_hidden_proposals_path }.to raise_exception(FeatureFlags::FeatureDisabled)
end
scenario "List shows all relevant info" do
diff --git a/spec/features/admin/legislation/draft_versions_spec.rb b/spec/features/admin/legislation/draft_versions_spec.rb
index 6f3dfc744..a4c3eae2b 100644
--- a/spec/features/admin/legislation/draft_versions_spec.rb
+++ b/spec/features/admin/legislation/draft_versions_spec.rb
@@ -18,7 +18,7 @@ describe "Admin legislation draft versions" do
scenario "Disabled with a feature flag" do
Setting["process.legislation"] = nil
process = create(:legislation_process)
- expect{ visit admin_legislation_process_draft_versions_path(process) }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect { visit admin_legislation_process_draft_versions_path(process) }.to raise_exception(FeatureFlags::FeatureDisabled)
end
end
diff --git a/spec/features/admin/legislation/processes_spec.rb b/spec/features/admin/legislation/processes_spec.rb
index bb9f63082..056202584 100644
--- a/spec/features/admin/legislation/processes_spec.rb
+++ b/spec/features/admin/legislation/processes_spec.rb
@@ -20,7 +20,7 @@ describe "Admin collaborative legislation" do
scenario "Disabled with a feature flag" do
Setting["process.legislation"] = nil
- expect{ visit admin_legislation_processes_path }
+ expect { visit admin_legislation_processes_path }
.to raise_exception(FeatureFlags::FeatureDisabled)
end
diff --git a/spec/features/admin/legislation/questions_spec.rb b/spec/features/admin/legislation/questions_spec.rb
index 06a03a64c..2ec091d86 100644
--- a/spec/features/admin/legislation/questions_spec.rb
+++ b/spec/features/admin/legislation/questions_spec.rb
@@ -21,7 +21,7 @@ describe "Admin legislation questions" do
end
scenario "Disabled with a feature flag" do
- expect{ visit admin_legislation_process_questions_path(process) }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect { visit admin_legislation_process_questions_path(process) }.to raise_exception(FeatureFlags::FeatureDisabled)
end
end
diff --git a/spec/features/admin/local_census_records_spec.rb b/spec/features/admin/local_census_records_spec.rb
index fa5db3dee..f11abfbd8 100644
--- a/spec/features/admin/local_census_records_spec.rb
+++ b/spec/features/admin/local_census_records_spec.rb
@@ -51,7 +51,7 @@ describe "Admin local census records" do
context "Search" do
before do
- create(:local_census_record, document_number: "X66777888" )
+ create(:local_census_record, document_number: "X66777888")
end
scenario "Should show matching records by document number at first visit" do
@@ -88,9 +88,9 @@ describe "Admin local census records" do
fill_in :local_census_record_document_type, with: "DNI"
fill_in :local_census_record_document_number, with: "#DOCUMENT"
- select "1982" , from: :local_census_record_date_of_birth_1i
- select "July" , from: :local_census_record_date_of_birth_2i
- select "7" , from: :local_census_record_date_of_birth_3i
+ select "1982", from: :local_census_record_date_of_birth_1i
+ select "July", from: :local_census_record_date_of_birth_2i
+ select "7", from: :local_census_record_date_of_birth_3i
fill_in :local_census_record_postal_code, with: "07003"
click_on "Save"
@@ -120,9 +120,9 @@ describe "Admin local census records" do
fill_in :local_census_record_document_type, with: "NIE"
fill_in :local_census_record_document_number, with: "#NIE_NUMBER"
- select "1982" , from: :local_census_record_date_of_birth_1i
- select "August" , from: :local_census_record_date_of_birth_2i
- select "8" , from: :local_census_record_date_of_birth_3i
+ select "1982", from: :local_census_record_date_of_birth_1i
+ select "August", from: :local_census_record_date_of_birth_2i
+ select "8", from: :local_census_record_date_of_birth_3i
fill_in :local_census_record_postal_code, with: "07007"
click_on "Save"
diff --git a/spec/features/admin/poll/polls_spec.rb b/spec/features/admin/poll/polls_spec.rb
index f5df4f678..a73e11f6d 100644
--- a/spec/features/admin/poll/polls_spec.rb
+++ b/spec/features/admin/poll/polls_spec.rb
@@ -220,7 +220,7 @@ describe "Admin polls" do
booth = create(:poll_booth, polls: [poll])
booth.booth_assignments.each do |booth_assignment|
- 3.times {create(:poll_officer_assignment, booth_assignment: booth_assignment) }
+ 3.times { create(:poll_officer_assignment, booth_assignment: booth_assignment) }
end
visit admin_poll_path(poll)
diff --git a/spec/features/admin/system_emails_spec.rb b/spec/features/admin/system_emails_spec.rb
index b1aed5bed..c2e6eb893 100644
--- a/spec/features/admin/system_emails_spec.rb
+++ b/spec/features/admin/system_emails_spec.rb
@@ -268,7 +268,7 @@ describe "System Emails" do
expect(page).to have_content comment.body
expect(page).to have_link "Cleaner city",
- href: admin_budget_budget_investment_url( investment.budget, investment, anchor: "comments")
+ href: admin_budget_budget_investment_url(investment.budget, investment, anchor: "comments")
end
end
diff --git a/spec/features/budgets/budgets_spec.rb b/spec/features/budgets/budgets_spec.rb
index 0f2f0a8bd..30410bfbb 100644
--- a/spec/features/budgets/budgets_spec.rb
+++ b/spec/features/budgets/budgets_spec.rb
@@ -380,7 +380,7 @@ describe "Budgets" do
visit budget_path(budget)
- budget.groups.each {|group| expect(page).to have_link(group.name)}
+ budget.groups.each { |group| expect(page).to have_link(group.name) }
end
scenario "Links to unfeasible and selected if balloting or later" do
diff --git a/spec/features/budgets/investments_spec.rb b/spec/features/budgets/investments_spec.rb
index d45599d68..0894d9314 100644
--- a/spec/features/budgets/investments_spec.rb
+++ b/spec/features/budgets/investments_spec.rb
@@ -195,9 +195,9 @@ describe "Budget Investments" do
context "Advanced search" do
scenario "Search by text", :js do
- bdgt_invest1 = create(:budget_investment, heading: heading,title: "Get Schwifty")
- bdgt_invest2 = create(:budget_investment, heading: heading,title: "Schwifty Hello")
- bdgt_invest3 = create(:budget_investment, heading: heading,title: "Do not show me")
+ bdgt_invest1 = create(:budget_investment, heading: heading, title: "Get Schwifty")
+ bdgt_invest2 = create(:budget_investment, heading: heading, title: "Schwifty Hello")
+ bdgt_invest3 = create(:budget_investment, heading: heading, title: "Do not show me")
visit budget_investments_path(budget)
@@ -339,9 +339,9 @@ describe "Budget Investments" do
context "Predefined date ranges" do
scenario "Last day", :js do
- bdgt_invest1 = create(:budget_investment, heading: heading,created_at: 1.minute.ago)
- bdgt_invest2 = create(:budget_investment, heading: heading,created_at: 1.hour.ago)
- bdgt_invest3 = create(:budget_investment, heading: heading,created_at: 2.days.ago)
+ bdgt_invest1 = create(:budget_investment, heading: heading, created_at: 1.minute.ago)
+ bdgt_invest2 = create(:budget_investment, heading: heading, created_at: 1.hour.ago)
+ bdgt_invest3 = create(:budget_investment, heading: heading, created_at: 2.days.ago)
visit budget_investments_path(budget)
@@ -359,9 +359,9 @@ describe "Budget Investments" do
end
scenario "Last week", :js do
- bdgt_invest1 = create(:budget_investment, heading: heading,created_at: 1.day.ago)
- bdgt_invest2 = create(:budget_investment, heading: heading,created_at: 5.days.ago)
- bdgt_invest3 = create(:budget_investment, heading: heading,created_at: 8.days.ago)
+ bdgt_invest1 = create(:budget_investment, heading: heading, created_at: 1.day.ago)
+ bdgt_invest2 = create(:budget_investment, heading: heading, created_at: 5.days.ago)
+ bdgt_invest3 = create(:budget_investment, heading: heading, created_at: 8.days.ago)
visit budget_investments_path(budget)
@@ -379,9 +379,9 @@ describe "Budget Investments" do
end
scenario "Last month", :js do
- bdgt_invest1 = create(:budget_investment, heading: heading,created_at: 10.days.ago)
- bdgt_invest2 = create(:budget_investment, heading: heading,created_at: 20.days.ago)
- bdgt_invest3 = create(:budget_investment, heading: heading,created_at: 33.days.ago)
+ bdgt_invest1 = create(:budget_investment, heading: heading, created_at: 10.days.ago)
+ bdgt_invest2 = create(:budget_investment, heading: heading, created_at: 20.days.ago)
+ bdgt_invest3 = create(:budget_investment, heading: heading, created_at: 33.days.ago)
visit budget_investments_path(budget)
@@ -399,9 +399,9 @@ describe "Budget Investments" do
end
scenario "Last year", :js do
- bdgt_invest1 = create(:budget_investment, heading: heading,created_at: 300.days.ago)
- bdgt_invest2 = create(:budget_investment, heading: heading,created_at: 350.days.ago)
- bdgt_invest3 = create(:budget_investment, heading: heading,created_at: 370.days.ago)
+ bdgt_invest1 = create(:budget_investment, heading: heading, created_at: 300.days.ago)
+ bdgt_invest2 = create(:budget_investment, heading: heading, created_at: 350.days.ago)
+ bdgt_invest3 = create(:budget_investment, heading: heading, created_at: 370.days.ago)
visit budget_investments_path(budget)
@@ -421,9 +421,9 @@ describe "Budget Investments" do
end
scenario "Search by custom date range", :js do
- bdgt_invest1 = create(:budget_investment, heading: heading,created_at: 2.days.ago)
- bdgt_invest2 = create(:budget_investment, heading: heading,created_at: 3.days.ago)
- bdgt_invest3 = create(:budget_investment, heading: heading,created_at: 9.days.ago)
+ bdgt_invest1 = create(:budget_investment, heading: heading, created_at: 2.days.ago)
+ bdgt_invest2 = create(:budget_investment, heading: heading, created_at: 3.days.ago)
+ bdgt_invest3 = create(:budget_investment, heading: heading, created_at: 9.days.ago)
visit budget_investments_path(budget)
@@ -443,9 +443,9 @@ describe "Budget Investments" do
end
scenario "Search by custom invalid date range", :js do
- bdgt_invest1 = create(:budget_investment, heading: heading,created_at: 2.days.ago)
- bdgt_invest2 = create(:budget_investment, heading: heading,created_at: 3.days.ago)
- bdgt_invest3 = create(:budget_investment, heading: heading,created_at: 9.days.ago)
+ bdgt_invest1 = create(:budget_investment, heading: heading, created_at: 2.days.ago)
+ bdgt_invest2 = create(:budget_investment, heading: heading, created_at: 3.days.ago)
+ bdgt_invest3 = create(:budget_investment, heading: heading, created_at: 9.days.ago)
visit budget_investments_path(budget)
@@ -468,9 +468,9 @@ describe "Budget Investments" do
ana = create :user, official_level: 1
john = create :user, official_level: 1
- bdgt_invest1 = create(:budget_investment, heading: heading,title: "Get Schwifty", author: ana, created_at: 1.minute.ago)
- bdgt_invest2 = create(:budget_investment, heading: heading,title: "Hello Schwifty", author: john, created_at: 2.days.ago)
- bdgt_invest3 = create(:budget_investment, heading: heading,title: "Save the forest")
+ bdgt_invest1 = create(:budget_investment, heading: heading, title: "Get Schwifty", author: ana, created_at: 1.minute.ago)
+ bdgt_invest2 = create(:budget_investment, heading: heading, title: "Hello Schwifty", author: john, created_at: 2.days.ago)
+ bdgt_invest3 = create(:budget_investment, heading: heading, title: "Save the forest")
visit budget_investments_path(budget)
@@ -861,7 +861,7 @@ describe "Budget Investments" do
end
def investments_order
- all(".budget-investment h3").collect {|i| i.text }
+ all(".budget-investment h3").collect { |i| i.text }
end
end
@@ -1419,7 +1419,7 @@ describe "Budget Investments" do
another_heading1 = create(:budget_heading, group: group2)
another_heading2 = create(:budget_heading, group: group2)
- heading_investment = create(:budget_investment, heading: heading)
+ heading_investment = create(:budget_investment, heading: heading)
another_group_investment = create(:budget_investment, heading: another_heading1)
create(:vote, votable: heading_investment, voter: author)
diff --git a/spec/features/budgets/votes_spec.rb b/spec/features/budgets/votes_spec.rb
index 9efdff7e7..6b079689f 100644
--- a/spec/features/budgets/votes_spec.rb
+++ b/spec/features/budgets/votes_spec.rb
@@ -54,7 +54,7 @@ describe "Votes" do
end
describe "Single investment" do
- let(:investment) { create(:budget_investment, budget: budget, heading: heading)}
+ let(:investment) { create(:budget_investment, budget: budget, heading: heading) }
scenario "Show no votes" do
visit budget_investment_path(budget, investment)
diff --git a/spec/features/comments/budget_investments_spec.rb b/spec/features/comments/budget_investments_spec.rb
index 9e09f6de9..6465e4489 100644
--- a/spec/features/comments/budget_investments_spec.rb
+++ b/spec/features/comments/budget_investments_spec.rb
@@ -164,7 +164,7 @@ describe "Commenting Budget::Investments" do
scenario "Paginated comments" do
per_page = 10
- (per_page + 2).times { create(:comment, commentable: investment)}
+ (per_page + 2).times { create(:comment, commentable: investment) }
visit budget_investment_path(investment.budget, investment)
diff --git a/spec/features/comments/debates_spec.rb b/spec/features/comments/debates_spec.rb
index 9e9734f0b..7d8f7663f 100644
--- a/spec/features/comments/debates_spec.rb
+++ b/spec/features/comments/debates_spec.rb
@@ -159,7 +159,7 @@ describe "Commenting debates" do
scenario "Paginated comments" do
per_page = 10
- (per_page + 2).times { create(:comment, commentable: debate)}
+ (per_page + 2).times { create(:comment, commentable: debate) }
visit debate_path(debate)
diff --git a/spec/features/comments/legislation_annotations_spec.rb b/spec/features/comments/legislation_annotations_spec.rb
index 1b3da8211..3a55801e2 100644
--- a/spec/features/comments/legislation_annotations_spec.rb
+++ b/spec/features/comments/legislation_annotations_spec.rb
@@ -190,7 +190,7 @@ describe "Commenting legislation questions" do
scenario "Paginated comments" do
per_page = 10
- (per_page + 2).times { create(:comment, commentable: legislation_annotation)}
+ (per_page + 2).times { create(:comment, commentable: legislation_annotation) }
visit legislation_process_draft_version_annotation_path(legislation_annotation.draft_version.process,
legislation_annotation.draft_version,
@@ -623,11 +623,11 @@ describe "Commenting legislation questions" do
let!(:draft_version) { create(:legislation_draft_version, :published) }
let!(:annotation1) do
create(:legislation_annotation, draft_version: draft_version, text: "my annotation",
- ranges: [{"start" => "/p[1]", "startOffset" => 1, "end" => "/p[1]", "endOffset" => 5}])
+ ranges: [{ "start" => "/p[1]", "startOffset" => 1, "end" => "/p[1]", "endOffset" => 5 }])
end
let!(:annotation2) do
create(:legislation_annotation, draft_version: draft_version, text: "my other annotation",
- ranges: [{"start" => "/p[1]", "startOffset" => 1, "end" => "/p[1]", "endOffset" => 10}])
+ ranges: [{ "start" => "/p[1]", "startOffset" => 1, "end" => "/p[1]", "endOffset" => 10 }])
end
before do
diff --git a/spec/features/comments/legislation_questions_spec.rb b/spec/features/comments/legislation_questions_spec.rb
index ecd1a0988..8a7ac63f5 100644
--- a/spec/features/comments/legislation_questions_spec.rb
+++ b/spec/features/comments/legislation_questions_spec.rb
@@ -166,7 +166,7 @@ describe "Commenting legislation questions" do
scenario "Paginated comments" do
per_page = 10
- (per_page + 2).times { create(:comment, commentable: legislation_question)}
+ (per_page + 2).times { create(:comment, commentable: legislation_question) }
visit legislation_process_question_path(legislation_question.process, legislation_question)
diff --git a/spec/features/comments/polls_spec.rb b/spec/features/comments/polls_spec.rb
index 6b0f84761..1baad1f24 100644
--- a/spec/features/comments/polls_spec.rb
+++ b/spec/features/comments/polls_spec.rb
@@ -160,7 +160,7 @@ describe "Commenting polls" do
scenario "Paginated comments" do
per_page = 10
- (per_page + 2).times { create(:comment, commentable: poll)}
+ (per_page + 2).times { create(:comment, commentable: poll) }
visit poll_path(poll)
diff --git a/spec/features/comments/proposals_spec.rb b/spec/features/comments/proposals_spec.rb
index e5e84d183..857de22ef 100644
--- a/spec/features/comments/proposals_spec.rb
+++ b/spec/features/comments/proposals_spec.rb
@@ -158,7 +158,7 @@ describe "Commenting proposals" do
scenario "Paginated comments" do
per_page = 10
- (per_page + 2).times { create(:comment, commentable: proposal)}
+ (per_page + 2).times { create(:comment, commentable: proposal) }
visit proposal_path(proposal)
diff --git a/spec/features/comments/topics_spec.rb b/spec/features/comments/topics_spec.rb
index ff6059e3d..a16cc1d89 100644
--- a/spec/features/comments/topics_spec.rb
+++ b/spec/features/comments/topics_spec.rb
@@ -173,7 +173,7 @@ describe "Commenting topics from proposals" do
community = proposal.community
topic = create(:topic, community: community)
per_page = 10
- (per_page + 2).times { create(:comment, commentable: topic)}
+ (per_page + 2).times { create(:comment, commentable: topic) }
visit community_topic_path(community, topic)
@@ -726,7 +726,7 @@ describe "Commenting topics from budget investments" do
community = investment.community
topic = create(:topic, community: community)
per_page = 10
- (per_page + 2).times { create(:comment, commentable: topic)}
+ (per_page + 2).times { create(:comment, commentable: topic) }
visit community_topic_path(community, topic)
diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb
index 9dfcbcc0f..e9a14464b 100644
--- a/spec/features/debates_spec.rb
+++ b/spec/features/debates_spec.rb
@@ -5,7 +5,7 @@ describe "Debates" do
scenario "Disabled with a feature flag" do
Setting["process.debates"] = nil
- expect{ visit debates_path }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect { visit debates_path }.to raise_exception(FeatureFlags::FeatureDisabled)
end
context "Concerns" do
diff --git a/spec/features/legislation/draft_versions_spec.rb b/spec/features/legislation/draft_versions_spec.rb
index d43256ea2..fc27e6815 100644
--- a/spec/features/legislation/draft_versions_spec.rb
+++ b/spec/features/legislation/draft_versions_spec.rb
@@ -184,9 +184,9 @@ describe "Legislation Draft Versions" do
scenario "View annotations and comments" do
draft_version = create(:legislation_draft_version, :published)
annotation1 = create(:legislation_annotation, draft_version: draft_version, text: "my annotation",
- ranges: [{"start" => "/p[1]", "startOffset" => 5, "end" => "/p[1]", "endOffset" => 10}])
+ ranges: [{ "start" => "/p[1]", "startOffset" => 5, "end" => "/p[1]", "endOffset" => 10 }])
create(:legislation_annotation, draft_version: draft_version, text: "my other annotation",
- ranges: [{"start" => "/p[1]", "startOffset" => 12, "end" => "/p[1]", "endOffset" => 19}])
+ ranges: [{ "start" => "/p[1]", "startOffset" => 12, "end" => "/p[1]", "endOffset" => 19 }])
comment = create(:comment, commentable: annotation1)
visit legislation_process_draft_version_path(draft_version.process, draft_version)
@@ -203,7 +203,7 @@ describe "Legislation Draft Versions" do
scenario "Publish new comment for an annotation from comments box" do
draft_version = create(:legislation_draft_version, :published)
annotation = create(:legislation_annotation, draft_version: draft_version, text: "my annotation",
- ranges: [{"start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11}])
+ ranges: [{ "start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11 }])
visit legislation_process_draft_version_path(draft_version.process, draft_version)
@@ -227,9 +227,9 @@ describe "Legislation Draft Versions" do
scenario "View annotations and comments in an included range" do
draft_version = create(:legislation_draft_version, :published)
annotation1 = create(:legislation_annotation, draft_version: draft_version, text: "my annotation",
- ranges: [{"start" => "/p[1]", "startOffset" => 1, "end" => "/p[1]", "endOffset" => 5}])
+ ranges: [{ "start" => "/p[1]", "startOffset" => 1, "end" => "/p[1]", "endOffset" => 5 }])
annotation2 = create(:legislation_annotation, draft_version: draft_version, text: "my other annotation",
- ranges: [{"start" => "/p[1]", "startOffset" => 1, "end" => "/p[1]", "endOffset" => 10}])
+ ranges: [{ "start" => "/p[1]", "startOffset" => 1, "end" => "/p[1]", "endOffset" => 10 }])
visit legislation_process_draft_version_path(draft_version.process, draft_version)
@@ -249,9 +249,9 @@ describe "Legislation Draft Versions" do
before do
@draft_version = create(:legislation_draft_version, :published)
create(:legislation_annotation, draft_version: @draft_version, text: "my annotation", quote: "ipsum",
- ranges: [{"start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11}])
+ ranges: [{ "start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11 }])
create(:legislation_annotation, draft_version: @draft_version, text: "my other annotation", quote: "audiam",
- ranges: [{"start" => "/p[3]", "startOffset" => 6, "end" => "/p[3]", "endOffset" => 11}])
+ ranges: [{ "start" => "/p[3]", "startOffset" => 6, "end" => "/p[3]", "endOffset" => 11 }])
end
scenario "See all annotations for a draft version" do
@@ -267,11 +267,11 @@ describe "Legislation Draft Versions" do
@draft_version_1 = create(:legislation_draft_version, :published, process: @process,
title: "Version 1", body: "Text with quote for version 1")
create(:legislation_annotation, draft_version: @draft_version_1, text: "annotation for version 1", quote: "quote for version 1",
- ranges: [{"start" => "/p[1]", "startOffset" => 11, "end" => "/p[1]", "endOffset" => 30}])
+ ranges: [{ "start" => "/p[1]", "startOffset" => 11, "end" => "/p[1]", "endOffset" => 30 }])
@draft_version_2 = create(:legislation_draft_version, :published, process: @process,
title: "Version 2", body: "Text with quote for version 2")
create(:legislation_annotation, draft_version: @draft_version_2, text: "annotation for version 2", quote: "quote for version 2",
- ranges: [{"start" => "/p[1]", "startOffset" => 11, "end" => "/p[1]", "endOffset" => 30}])
+ ranges: [{ "start" => "/p[1]", "startOffset" => 11, "end" => "/p[1]", "endOffset" => 30 }])
end
scenario "without js" do
@@ -301,9 +301,9 @@ describe "Legislation Draft Versions" do
before do
@draft_version = create(:legislation_draft_version, :published)
create(:legislation_annotation, draft_version: @draft_version, text: "my annotation", quote: "ipsum",
- ranges: [{"start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11}])
+ ranges: [{ "start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11 }])
@annotation = create(:legislation_annotation, draft_version: @draft_version, text: "my other annotation", quote: "audiam",
- ranges: [{"start" => "/p[3]", "startOffset" => 6, "end" => "/p[3]", "endOffset" => 11}])
+ ranges: [{ "start" => "/p[3]", "startOffset" => 6, "end" => "/p[3]", "endOffset" => 11 }])
end
scenario "See one annotation with replies for a draft version" do
diff --git a/spec/features/legislation/resume_spec.rb b/spec/features/legislation/resume_spec.rb
index 09f703be8..749826980 100644
--- a/spec/features/legislation/resume_spec.rb
+++ b/spec/features/legislation/resume_spec.rb
@@ -180,13 +180,13 @@ describe "Legislation" do
status: "published")
annotation0 = create(:legislation_annotation,
draft_version: draft_version_1, text: "my annotation123",
- ranges: [{"start" => "/p[1]", "startOffset" => 5, "end" => "/p[1]", "endOffset" => 10}])
+ ranges: [{ "start" => "/p[1]", "startOffset" => 5, "end" => "/p[1]", "endOffset" => 10 }])
annotation1 = create(:legislation_annotation,
draft_version: draft_version_2, text: "hola",
- ranges: [{"start" => "/p[1]", "startOffset" => 5, "end" => "/p[1]", "endOffset" => 10}])
+ ranges: [{ "start" => "/p[1]", "startOffset" => 5, "end" => "/p[1]", "endOffset" => 10 }])
annotation2 = create(:legislation_annotation,
draft_version: draft_version_2,
- ranges: [{"start" => "/p[1]", "startOffset" => 12, "end" => "/p[1]", "endOffset" => 19}])
+ ranges: [{ "start" => "/p[1]", "startOffset" => 12, "end" => "/p[1]", "endOffset" => 19 }])
create(:text_comment, user: user, commentable_id: annotation0.id, body: "Comment 0")
create(:text_comment, user: user, commentable_id: annotation1.id, body: "Comment 1")
create(:text_comment, user: user, commentable_id: annotation2.id, body: "Comment 2")
@@ -238,7 +238,7 @@ describe "Legislation" do
end
it "download execl file test" do
- get :resume, params: {id: @process, format: :xlsx}
+ get :resume, params: { id: @process, format: :xlsx }
expect(response).to be_success
end
end
diff --git a/spec/features/moderation/budget_investments_spec.rb b/spec/features/moderation/budget_investments_spec.rb
index 2d8bcc4c8..58c996038 100644
--- a/spec/features/moderation/budget_investments_spec.rb
+++ b/spec/features/moderation/budget_investments_spec.rb
@@ -15,7 +15,7 @@ describe "Moderate budget investments" do
Setting["process.budgets"] = nil
login_as(@mod.user)
- expect{ visit moderation_budget_investments_path }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect { visit moderation_budget_investments_path }.to raise_exception(FeatureFlags::FeatureDisabled)
end
scenario "Hiding an investment", :js do
diff --git a/spec/features/moderation/debates_spec.rb b/spec/features/moderation/debates_spec.rb
index a3d213b5e..a331827a5 100644
--- a/spec/features/moderation/debates_spec.rb
+++ b/spec/features/moderation/debates_spec.rb
@@ -7,7 +7,7 @@ describe "Moderate debates" do
moderator = create(:moderator)
login_as(moderator.user)
- expect{ visit moderation_debates_path }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect { visit moderation_debates_path }.to raise_exception(FeatureFlags::FeatureDisabled)
end
scenario "Hide", :js do
diff --git a/spec/features/moderation/proposals_spec.rb b/spec/features/moderation/proposals_spec.rb
index 3bb443699..4388919ca 100644
--- a/spec/features/moderation/proposals_spec.rb
+++ b/spec/features/moderation/proposals_spec.rb
@@ -7,7 +7,7 @@ describe "Moderate proposals" do
moderator = create(:moderator)
login_as(moderator.user)
- expect{ visit moderation_proposals_path }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect { visit moderation_proposals_path }.to raise_exception(FeatureFlags::FeatureDisabled)
end
scenario "Hide", :js do
diff --git a/spec/features/officing/voters_spec.rb b/spec/features/officing/voters_spec.rb
index c70738ea2..b2660b543 100644
--- a/spec/features/officing/voters_spec.rb
+++ b/spec/features/officing/voters_spec.rb
@@ -178,8 +178,8 @@ describe "Voters" do
second_booth = create(:poll_booth)
- ba1 = create(:poll_booth_assignment, poll: poll1, booth: second_booth )
- ba2 = create(:poll_booth_assignment, poll: poll2, booth: second_booth )
+ ba1 = create(:poll_booth_assignment, poll: poll1, booth: second_booth)
+ ba2 = create(:poll_booth_assignment, poll: poll2, booth: second_booth)
create(:poll_shift, officer: officer, booth: second_booth, date: Date.current, task: :vote_collection)
validate_officer
diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb
index 4f8a1c904..19aa724d6 100644
--- a/spec/features/proposals_spec.rb
+++ b/spec/features/proposals_spec.rb
@@ -9,7 +9,7 @@ describe "Proposals" do
scenario "Disabled with a feature flag" do
Setting["process.proposals"] = nil
- expect{ visit proposals_path }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect { visit proposals_path }.to raise_exception(FeatureFlags::FeatureDisabled)
end
context "Concerns" do
@@ -1621,7 +1621,7 @@ describe "Proposals" do
it_behaves_like "nested imageable",
"proposal",
"new_proposal_path",
- { },
+ {},
"imageable_fill_new_valid_proposal",
"Create proposal",
"Proposal created successfully"
@@ -1640,7 +1640,7 @@ describe "Proposals" do
"user",
"proposal",
"new_proposal_path",
- { },
+ {},
"documentable_fill_new_valid_proposal",
"Create proposal",
"Proposal created successfully"
@@ -1660,7 +1660,7 @@ describe "Proposals" do
"new_proposal_path",
"edit_proposal_path",
"proposal_path",
- { }
+ {}
scenario "Erased author" do
user = create(:user)
diff --git a/spec/features/social_media_meta_tags_spec.rb b/spec/features/social_media_meta_tags_spec.rb
index 50c0cd012..34d43b337 100644
--- a/spec/features/social_media_meta_tags_spec.rb
+++ b/spec/features/social_media_meta_tags_spec.rb
@@ -41,7 +41,7 @@ describe "Social media meta tags" do
expect(page).to have_meta "twitter:title", with: meta_title
expect(page).to have_meta "twitter:description", with: meta_description
expect(page).to have_meta "twitter:image",
- with:"http://www.example.com/social_media_icon_twitter.png"
+ with: "http://www.example.com/social_media_icon_twitter.png"
expect(page).to have_property "og:title", with: meta_title
expect(page).to have_property "article:publisher", with: url
diff --git a/spec/features/tracking/budget_investments_spec.rb b/spec/features/tracking/budget_investments_spec.rb
index 58ad21325..4028635b7 100644
--- a/spec/features/tracking/budget_investments_spec.rb
+++ b/spec/features/tracking/budget_investments_spec.rb
@@ -13,7 +13,7 @@ describe "Valuation budget investments" do
scenario "Disabled with a feature flag" do
Setting["process.budgets"] = nil
- expect{
+ expect {
visit tracking_budget_budget_investments_path(create(:budget))
}.to raise_exception(FeatureFlags::FeatureDisabled)
end
@@ -161,7 +161,7 @@ describe "Valuation budget investments" do
logout
login_as create(:tracker).user
- expect{
+ expect {
visit tracking_budget_budget_investment_path(budget, investment)
}.to raise_error "Not Found"
end
@@ -273,7 +273,7 @@ describe "Valuation budget investments" do
logout
login_as create(:tracker, user: create(:user)).user
- expect{
+ expect {
visit tracking_budget_budget_investment_progress_bars_path(budget, investment)
}.to raise_error "Not Found"
end
diff --git a/spec/features/tracking/budgets_spec.rb b/spec/features/tracking/budgets_spec.rb
index b6fb44890..56607995a 100644
--- a/spec/features/tracking/budgets_spec.rb
+++ b/spec/features/tracking/budgets_spec.rb
@@ -10,7 +10,7 @@ describe "Tracking budgets" do
scenario "Disabled with a feature flag" do
Setting["process.budgets"] = nil
- expect{ visit tracking_budgets_path }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect { visit tracking_budgets_path }.to raise_exception(FeatureFlags::FeatureDisabled)
end
context "Index" do
diff --git a/spec/features/users_auth_spec.rb b/spec/features/users_auth_spec.rb
index e191053cf..a985dbae0 100644
--- a/spec/features/users_auth_spec.rb
+++ b/spec/features/users_auth_spec.rb
@@ -106,8 +106,8 @@ describe "Users" do
context "OAuth authentication" do
context "Twitter" do
- let(:twitter_hash){ {provider: "twitter", uid: "12345", info: {name: "manuela"}} }
- let(:twitter_hash_with_email){ {provider: "twitter", uid: "12345", info: {name: "manuela", email: "manuelacarmena@example.com"}} }
+ let(:twitter_hash) { { provider: "twitter", uid: "12345", info: { name: "manuela" }} }
+ let(:twitter_hash_with_email) { { provider: "twitter", uid: "12345", info: { name: "manuela", email: "manuelacarmena@example.com" }} }
let(:twitter_hash_with_verified_email) do
{
provider: "twitter",
diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb
index 051363946..f5a2fa4fb 100644
--- a/spec/features/users_spec.rb
+++ b/spec/features/users_spec.rb
@@ -6,10 +6,10 @@ describe "Users" do
before do
@user = create(:user)
- 1.times {create(:debate, author: @user)}
- 2.times {create(:proposal, author: @user)}
- 3.times {create(:budget_investment, author: @user)}
- 4.times {create(:comment, user: @user)}
+ 1.times { create(:debate, author: @user) }
+ 2.times { create(:proposal, author: @user) }
+ 3.times { create(:budget_investment, author: @user) }
+ 4.times { create(:comment, user: @user) }
visit user_path(@user)
end
@@ -401,9 +401,9 @@ describe "Users" do
scenario "shows only comments from active features" do
user = create(:user)
- 1.times {create(:comment, user: user, commentable: create(:debate))}
- 2.times {create(:comment, user: user, commentable: create(:budget_investment))}
- 4.times {create(:comment, user: user, commentable: create(:proposal))}
+ 1.times { create(:comment, user: user, commentable: create(:debate)) }
+ 2.times { create(:comment, user: user, commentable: create(:budget_investment)) }
+ 4.times { create(:comment, user: user, commentable: create(:proposal)) }
visit user_path(user)
expect(page).to have_content("7 Comments")
diff --git a/spec/features/valuation/budget_investments_spec.rb b/spec/features/valuation/budget_investments_spec.rb
index ea95e184a..76742f029 100644
--- a/spec/features/valuation/budget_investments_spec.rb
+++ b/spec/features/valuation/budget_investments_spec.rb
@@ -37,7 +37,7 @@ describe "Valuation budget investments" do
scenario "Disabled with a feature flag" do
Setting["process.budgets"] = nil
- expect{
+ expect {
visit valuation_budget_budget_investments_path(create(:budget))
}.to raise_exception(FeatureFlags::FeatureDisabled)
end
@@ -188,8 +188,8 @@ describe "Valuation budget investments" do
end
scenario "Current filter is properly highlighted" do
- filters_links = {"valuating" => "Under valuation",
- "valuation_finished" => "Valuation finished"}
+ filters_links = { "valuating" => "Under valuation",
+ "valuation_finished" => "Valuation finished" }
visit valuation_budget_budget_investments_path(budget)
@@ -298,7 +298,7 @@ describe "Valuation budget investments" do
logout
login_as create(:valuator).user
- expect{
+ expect {
visit valuation_budget_budget_investment_path(budget, investment)
}.to raise_error "Not Found"
end
diff --git a/spec/features/valuation/budgets_spec.rb b/spec/features/valuation/budgets_spec.rb
index bb0d51059..6529f9967 100644
--- a/spec/features/valuation/budgets_spec.rb
+++ b/spec/features/valuation/budgets_spec.rb
@@ -9,7 +9,7 @@ describe "Valuation budgets" do
scenario "Disabled with a feature flag" do
Setting["process.budgets"] = nil
- expect{ visit valuation_budgets_path }.to raise_exception(FeatureFlags::FeatureDisabled)
+ expect { visit valuation_budgets_path }.to raise_exception(FeatureFlags::FeatureDisabled)
end
context "Index" do
diff --git a/spec/helpers/votes_helper_spec.rb b/spec/helpers/votes_helper_spec.rb
index 41dd80c7f..259025e63 100644
--- a/spec/helpers/votes_helper_spec.rb
+++ b/spec/helpers/votes_helper_spec.rb
@@ -5,14 +5,14 @@ describe VotesHelper do
describe "#voted_for?" do
it "returns true if voted for a proposal" do
proposal = create(:proposal)
- votes = {proposal.id => true}
+ votes = { proposal.id => true }
expect(voted_for?(votes, proposal)).to eq(true)
end
it "returns false if not voted for a proposals" do
proposal = create(:proposal)
- votes = {proposal.id => nil}
+ votes = { proposal.id => nil }
expect(voted_for?(votes, proposal)).to eq(nil)
end
diff --git a/spec/i18n_spec.rb b/spec/i18n_spec.rb
index 565c63af8..7cbd11ca6 100644
--- a/spec/i18n_spec.rb
+++ b/spec/i18n_spec.rb
@@ -40,7 +40,7 @@ describe "I18n" do
other: "%{count} comments" }
I18n.backend.store_translations(I18n.default_locale, { test_plural: keys })
- I18n.backend.store_translations(:zz, {} )
+ I18n.backend.store_translations(:zz, {})
I18n.enforce_available_locales = false
I18n.locale = :zz
diff --git a/spec/lib/cache_spec.rb b/spec/lib/cache_spec.rb
index a80fa9da3..5d5ddb0fe 100644
--- a/spec/lib/cache_spec.rb
+++ b/spec/lib/cache_spec.rb
@@ -7,7 +7,7 @@ describe "Cache flow" do
debate = create(:debate, tag_list: "Good, Bad")
tag = ActsAsTaggableOn::Tag.find_by(name: "Bad")
- expect{tag.destroy}.to change {debate.reload.cache_key}
+ expect { tag.destroy }.to change { debate.reload.cache_key }
end
end
diff --git a/spec/lib/census_api_spec.rb b/spec/lib/census_api_spec.rb
index ce1e57a92..4af0320a2 100644
--- a/spec/lib/census_api_spec.rb
+++ b/spec/lib/census_api_spec.rb
@@ -4,7 +4,7 @@ describe CensusApi do
let(:api) { described_class.new }
describe "#call" do
- let(:invalid_body) { {get_habita_datos_response: {get_habita_datos_return: {datos_habitante: {}}}} }
+ let(:invalid_body) { { get_habita_datos_response: { get_habita_datos_return: { datos_habitante: {}}}} }
let(:valid_body) do
{
get_habita_datos_response: {
diff --git a/spec/lib/census_caller_spec.rb b/spec/lib/census_caller_spec.rb
index a680df52e..77455d4cb 100644
--- a/spec/lib/census_caller_spec.rb
+++ b/spec/lib/census_caller_spec.rb
@@ -6,7 +6,7 @@ describe CensusCaller do
describe "#call" do
it "returns data from local_census_records if census API is not available" do
census_api_response = CensusApi::Response.new(get_habita_datos_response: {
- get_habita_datos_return: { datos_habitante: {}, datos_vivienda: {} }
+ get_habita_datos_return: { datos_habitante: {}, datos_vivienda: {}}
}
)
@@ -26,7 +26,7 @@ describe CensusCaller do
it "returns data from census API if it's available and valid" do
census_api_response = CensusApi::Response.new(get_habita_datos_response: {
get_habita_datos_return: {
- datos_habitante: { item: { fecha_nacimiento_string: "1-1-1980" } }
+ datos_habitante: { item: { fecha_nacimiento_string: "1-1-1980" }}
}
})
@@ -58,7 +58,7 @@ describe CensusCaller do
remote_census_api_response = RemoteCensusApi::Response.new(get_habita_datos_response: {
get_habita_datos_return: {
- datos_habitante: { item: { fecha_nacimiento_string: "1-1-1980" } }
+ datos_habitante: { item: { fecha_nacimiento_string: "1-1-1980" }}
}
})
@@ -82,7 +82,7 @@ describe CensusCaller do
remote_census_api_response = RemoteCensusApi::Response.new(get_habita_datos_response: {
get_habita_datos_return: {
- datos_habitante: { item: { fecha_nacimiento_string: "1-1-1980" } }
+ datos_habitante: { item: { fecha_nacimiento_string: "1-1-1980" }}
}
})
diff --git a/spec/lib/evaluation_comment_email_spec.rb b/spec/lib/evaluation_comment_email_spec.rb
index 18b85c197..ec4ed6f33 100644
--- a/spec/lib/evaluation_comment_email_spec.rb
+++ b/spec/lib/evaluation_comment_email_spec.rb
@@ -3,7 +3,7 @@ require "rails_helper"
describe EvaluationCommentEmail do
let(:author) { create(:user) }
- let(:administrator) { create(:administrator)}
+ let(:administrator) { create(:administrator) }
let(:investment) { create(:budget_investment, author: author, administrator: administrator) }
let(:commenter) { create(:user, email: "email@commenter.org") }
let(:comment) { create(:comment, commentable: investment, user: commenter) }
diff --git a/spec/lib/graph_ql/query_type_creator_spec.rb b/spec/lib/graph_ql/query_type_creator_spec.rb
index 5d0c2328c..e70830c30 100644
--- a/spec/lib/graph_ql/query_type_creator_spec.rb
+++ b/spec/lib/graph_ql/query_type_creator_spec.rb
@@ -3,8 +3,8 @@ require "rails_helper"
describe GraphQL::QueryTypeCreator do
let(:api_type_definitions) do
{
- ProposalNotification => { fields: { title: :string } },
- Proposal => { fields: { id: :integer, title: :string } }
+ ProposalNotification => { fields: { title: :string }},
+ Proposal => { fields: { id: :integer, title: :string }}
}
end
let(:api_types) { GraphQL::ApiTypesCreator.create(api_type_definitions) }
diff --git a/spec/lib/graphql_spec.rb b/spec/lib/graphql_spec.rb
index 18d80aa41..4c4144140 100644
--- a/spec/lib/graphql_spec.rb
+++ b/spec/lib/graphql_spec.rb
@@ -435,7 +435,7 @@ describe "Consul Schema" do
describe "Geozones" do
it "returns geozones" do
- geozone_names = [ create(:geozone), create(:geozone) ].map { |geozone| geozone.name }
+ geozone_names = [create(:geozone), create(:geozone)].map { |geozone| geozone.name }
response = execute("{ geozones { edges { node { name } } } }")
received_names = extract_fields(response, "geozones", "name")
diff --git a/spec/lib/manager_authenticator_spec.rb b/spec/lib/manager_authenticator_spec.rb
index a696074aa..d696537fd 100644
--- a/spec/lib/manager_authenticator_spec.rb
+++ b/spec/lib/manager_authenticator_spec.rb
@@ -45,7 +45,7 @@ describe ManagerAuthenticator do
describe "SOAP" do
it "calls the verification user method" do
- message = { ub: {user_key: "31415926", date: "20151031135905"} }
+ message = { ub: { user_key: "31415926", date: "20151031135905" }}
allow(authenticator).to receive(:application_authorized?).and_return(true)
allow(authenticator.send(:client)).to receive(:call).with(:get_status_user_data, message: message)
authenticator.auth
@@ -53,7 +53,7 @@ describe ManagerAuthenticator do
it "calls the permissions check method" do
allow(authenticator).to receive(:manager_exists?).and_return(true)
- allow(authenticator.send(:client)).to receive(:call).with(:get_applications_user_list, message: { ub: {user_key: "31415926"} })
+ allow(authenticator.send(:client)).to receive(:call).with(:get_applications_user_list, message: { ub: { user_key: "31415926" }})
authenticator.auth
end
end
diff --git a/spec/lib/remote_census_api_spec.rb b/spec/lib/remote_census_api_spec.rb
index 786616918..1d9f0651b 100644
--- a/spec/lib/remote_census_api_spec.rb
+++ b/spec/lib/remote_census_api_spec.rb
@@ -4,7 +4,7 @@ describe RemoteCensusApi do
let(:api) { described_class.new }
describe "#call" do
- let(:invalid_body) { {get_habita_datos_response: {get_habita_datos_return: {datos_habitante: {}}}} }
+ let(:invalid_body) { { get_habita_datos_response: { get_habita_datos_return: { datos_habitante: {}}}} }
let(:valid_body) do
{
get_habita_datos_response: {
@@ -86,33 +86,33 @@ describe RemoteCensusApi do
request = RemoteCensusApi.new.send(:request, document_type, document_number, nil, nil)
- expect(request).to eq ({:request=>
- {:codigo_institucion=>1,
- :codigo_portal=>1,
- :codigo_usuario=>1,
- :documento=>"0123456",
- :tipo_documento=>"1",
- :codigo_idioma=>"102",
- :nivel=>"3"}
+ expect(request).to eq ({ :request =>
+ { :codigo_institucion => 1,
+ :codigo_portal => 1,
+ :codigo_usuario => 1,
+ :documento => "0123456",
+ :tipo_documento => "1",
+ :codigo_idioma => "102",
+ :nivel => "3" }
})
end
it "when send date_of_birth and postal_code but are not configured" do
document_type = "1"
document_number = "0123456"
- date_of_birth = Date.new(1980, 1, 1)
+ date_of_birth = Date.new(1980, 1, 1)
postal_code = "28001"
request = RemoteCensusApi.new.send(:request, document_type, document_number, date_of_birth, postal_code)
- expect(request).to eq ({:request=>
- {:codigo_institucion=>1,
- :codigo_portal=>1,
- :codigo_usuario=>1,
- :documento=>"0123456",
- :tipo_documento=>"1",
- :codigo_idioma=>"102",
- :nivel=>"3"}
+ expect(request).to eq ({ :request =>
+ { :codigo_institucion => 1,
+ :codigo_portal => 1,
+ :codigo_usuario => 1,
+ :documento => "0123456",
+ :tipo_documento => "1",
+ :codigo_idioma => "102",
+ :nivel => "3" }
})
end
@@ -132,21 +132,21 @@ describe RemoteCensusApi do
Setting["remote_census.request.postal_code"] = "request.codigo_postal"
document_type = "1"
document_number = "0123456"
- date_of_birth = Date.new(1980, 1, 1)
+ date_of_birth = Date.new(1980, 1, 1)
postal_code = "28001"
request = RemoteCensusApi.new.send(:request, document_type, document_number, date_of_birth, postal_code)
- expect(request).to eq ({:request=>
- {:codigo_institucion=>1,
- :codigo_portal=>1,
- :codigo_usuario=>1,
- :documento=>"0123456",
- :tipo_documento=>"1",
- :fecha_nacimiento=>"1980-01-01",
- :codigo_postal=>"28001",
- :codigo_idioma=>"102",
- :nivel=>"3"}
+ expect(request).to eq ({ :request =>
+ { :codigo_institucion => 1,
+ :codigo_portal => 1,
+ :codigo_usuario => 1,
+ :documento => "0123456",
+ :tipo_documento => "1",
+ :fecha_nacimiento => "1980-01-01",
+ :codigo_postal => "28001",
+ :codigo_idioma => "102",
+ :nivel => "3" }
})
end
diff --git a/spec/lib/remote_translations/microsoft/client_spec.rb b/spec/lib/remote_translations/microsoft/client_spec.rb
index fcabb5c1d..42e8e7b0c 100644
--- a/spec/lib/remote_translations/microsoft/client_spec.rb
+++ b/spec/lib/remote_translations/microsoft/client_spec.rb
@@ -12,7 +12,7 @@ describe RemoteTranslations::Microsoft::Client do
expect_any_instance_of(TranslatorText::Client).to receive(:translate).and_return(response)
- result = client.call([ "New title", "New description"], :es)
+ result = client.call(["New title", "New description"], :es)
expect(result).to eq(["Nuevo título", "Nueva descripción"])
end
diff --git a/spec/lib/tasks/dashboards_spec.rb b/spec/lib/tasks/dashboards_spec.rb
index f0d4ab8de..55368ee6f 100644
--- a/spec/lib/tasks/dashboards_spec.rb
+++ b/spec/lib/tasks/dashboards_spec.rb
@@ -31,7 +31,7 @@ describe "Dashboards Rake" do
action.update(published_proposal: true)
resource.update(published_proposal: true)
- expect {run_rake_task}.to change { ActionMailer::Base.deliveries.count }.by(0)
+ expect { run_rake_task }.to change { ActionMailer::Base.deliveries.count }.by(0)
end
it "when there are not news actions actived for draft proposals" do
@@ -39,7 +39,7 @@ describe "Dashboards Rake" do
action.update(published_proposal: false)
resource.update(published_proposal: false)
- expect {run_rake_task}.to change { ActionMailer::Base.deliveries.count }.by(0)
+ expect { run_rake_task }.to change { ActionMailer::Base.deliveries.count }.by(0)
end
it "when there are news actions actived for archived proposals" do
@@ -47,7 +47,7 @@ describe "Dashboards Rake" do
action.update(day_offset: 0, published_proposal: true)
resource.update(day_offset: 0, published_proposal: true)
- expect {run_rake_task}.to change { ActionMailer::Base.deliveries.count }.by(0)
+ expect { run_rake_task }.to change { ActionMailer::Base.deliveries.count }.by(0)
end
end
diff --git a/spec/lib/user_segments_spec.rb b/spec/lib/user_segments_spec.rb
index e634076cb..64f9b069c 100644
--- a/spec/lib/user_segments_spec.rb
+++ b/spec/lib/user_segments_spec.rb
@@ -8,7 +8,7 @@ describe UserSegments do
describe "#all_users" do
it "returns all active users enabled" do
active_user = create(:user)
- erased_user = create(:user, erased_at: Time.current)
+ erased_user = create(:user, erased_at: Time.current)
expect(described_class.all_users).to include active_user
expect(described_class.all_users).not_to include erased_user
diff --git a/spec/models/abilities/administrator_spec.rb b/spec/models/abilities/administrator_spec.rb
index aeeff5cf6..a4c37e0c7 100644
--- a/spec/models/abilities/administrator_spec.rb
+++ b/spec/models/abilities/administrator_spec.rb
@@ -88,10 +88,10 @@ describe Abilities::Administrator do
it { should be_able_to(:stats, poll) }
it { should be_able_to(:results, poll) }
- it { should be_able_to(:read, Poll::Question)}
- it { should be_able_to(:create, Poll::Question)}
- it { should be_able_to(:update, Poll::Question)}
- it { should be_able_to(:get_options_traductions, Poll::Question)}
+ it { should be_able_to(:read, Poll::Question) }
+ it { should be_able_to(:create, Poll::Question) }
+ it { should be_able_to(:update, Poll::Question) }
+ it { should be_able_to(:get_options_traductions, Poll::Question) }
it { is_expected.to be_able_to :manage, Dashboard::AdministratorTask }
it { is_expected.to be_able_to :manage, dashboard_administrator_task }
diff --git a/spec/models/abilities/common_spec.rb b/spec/models/abilities/common_spec.rb
index 9e7b75b3f..240db85f9 100644
--- a/spec/models/abilities/common_spec.rb
+++ b/spec/models/abilities/common_spec.rb
@@ -189,7 +189,7 @@ describe Abilities::Common do
describe "when level 2 verified" do
let(:own_direct_message) { create(:direct_message, sender: user) }
- before{ user.update(residence_verified_at: Time.current, confirmed_phone: "1") }
+ before { user.update(residence_verified_at: Time.current, confirmed_phone: "1") }
describe "Proposal" do
it { should be_able_to(:vote, Proposal) }
@@ -274,7 +274,7 @@ describe Abilities::Common do
describe "when level 3 verified" do
let(:own_direct_message) { create(:direct_message, sender: user) }
- before{ user.update(verified_at: Time.current) }
+ before { user.update(verified_at: Time.current) }
it { should be_able_to(:vote, Proposal) }
it { should be_able_to(:vote_featured, Proposal) }
diff --git a/spec/models/activity_spec.rb b/spec/models/activity_spec.rb
index 39b8650ff..e9317d4c3 100644
--- a/spec/models/activity_spec.rb
+++ b/spec/models/activity_spec.rb
@@ -23,7 +23,7 @@ describe Activity do
user = create(:user)
proposal = create(:proposal)
- expect{ described_class.log(user, :hide, proposal) }.to change { described_class.count }.by(1)
+ expect { described_class.log(user, :hide, proposal) }.to change { described_class.count }.by(1)
activity = described_class.last
expect(activity.user_id).to eq(user.id)
diff --git a/spec/models/administrator_spec.rb b/spec/models/administrator_spec.rb
index 39b740980..7673b898a 100644
--- a/spec/models/administrator_spec.rb
+++ b/spec/models/administrator_spec.rb
@@ -3,7 +3,7 @@ require "rails_helper"
describe Administrator do
describe "#description_or_name" do
- let!(:user) { create(:user, username: "Billy Wilder" )}
+ let!(:user) { create(:user, username: "Billy Wilder") }
it "returns description if present" do
administrator = create(:administrator, user: user, description: "John Doe")
@@ -25,7 +25,7 @@ describe Administrator do
end
describe "#description_or_name_and_email" do
- let!(:user) { create(:user, username: "Billy Wilder", email: "test@test.com")}
+ let!(:user) { create(:user, username: "Billy Wilder", email: "test@test.com") }
it "returns description and email if decription present" do
administrator = create(:administrator,
diff --git a/spec/models/budget/ballot/line_spec.rb b/spec/models/budget/ballot/line_spec.rb
index e73d54046..102df8ab8 100644
--- a/spec/models/budget/ballot/line_spec.rb
+++ b/spec/models/budget/ballot/line_spec.rb
@@ -2,10 +2,10 @@ require "rails_helper"
describe Budget::Ballot::Line do
- let(:budget){ create(:budget) }
- let(:group){ create(:budget_group, budget: budget) }
- let(:heading){ create(:budget_heading, group: group, price: 10000000) }
- let(:investment){ create(:budget_investment, :selected, price: 5000000, heading: heading) }
+ let(:budget) { create(:budget) }
+ let(:group) { create(:budget_group, budget: budget) }
+ let(:heading) { create(:budget_heading, group: group, price: 10000000) }
+ let(:investment) { create(:budget_investment, :selected, price: 5000000, heading: heading) }
let(:ballot) { create(:budget_ballot, budget: budget) }
let(:ballot_line) { build(:budget_ballot_line, ballot: ballot, investment: investment) }
diff --git a/spec/models/budget/investment_spec.rb b/spec/models/budget/investment_spec.rb
index f8bd836e9..380082912 100644
--- a/spec/models/budget/investment_spec.rb
+++ b/spec/models/budget/investment_spec.rb
@@ -124,7 +124,7 @@ describe Budget::Investment do
end
it "send an email" do
- expect {investment.send_unfeasible_email}.to change { ActionMailer::Base.deliveries.count }.by(1)
+ expect { investment.send_unfeasible_email }.to change { ActionMailer::Base.deliveries.count }.by(1)
end
end
@@ -137,7 +137,7 @@ describe Budget::Investment do
end
it "returns false in any other phase" do
- Budget::Phase::PHASE_KINDS.reject {|phase| phase == "selecting"}.each do |phase|
+ Budget::Phase::PHASE_KINDS.reject { |phase| phase == "selecting" }.each do |phase|
budget = create(:budget, phase: phase)
investment = create(:budget_investment, budget: budget)
@@ -155,7 +155,7 @@ describe Budget::Investment do
end
it "returns false in any other phase" do
- Budget::Phase::PHASE_KINDS.reject {|phase| phase == "valuating"}.each do |phase|
+ Budget::Phase::PHASE_KINDS.reject { |phase| phase == "valuating" }.each do |phase|
budget = create(:budget, phase: phase)
investment = create(:budget_investment, budget: budget)
@@ -180,7 +180,7 @@ describe Budget::Investment do
end
it "returns false in any other phase" do
- Budget::Phase::PHASE_KINDS.reject {|phase| phase == "balloting"}.each do |phase|
+ Budget::Phase::PHASE_KINDS.reject { |phase| phase == "balloting" }.each do |phase|
budget = create(:budget, phase: phase)
investment = create(:budget_investment, :selected, budget: budget)
@@ -386,17 +386,17 @@ describe Budget::Investment do
let!(:investment) { create(:budget_investment, :feasible, heading: heading) }
it "finds budget by id or slug" do
- result = described_class.scoped_filter({budget_id: budget.id}, nil)
+ result = described_class.scoped_filter({ budget_id: budget.id }, nil)
expect(result.count).to be 1
expect(result.first.id).to be investment.id
- result = described_class.scoped_filter({budget_id: "budget_slug"}, nil)
+ result = described_class.scoped_filter({ budget_id: "budget_slug" }, nil)
expect(result.count).to be 1
expect(result.first.id).to be investment.id
end
it "does not raise error if budget is not found" do
- result = described_class.scoped_filter({budget_id: "wrong_budget"}, nil)
+ result = described_class.scoped_filter({ budget_id: "wrong_budget" }, nil)
expect(result).to be_empty
end
@@ -1094,7 +1094,7 @@ describe Budget::Investment do
end
it "returns false if budget is not balloting phase" do
- Budget::Phase::PHASE_KINDS.reject {|phase| phase == "balloting"}.each do |phase|
+ Budget::Phase::PHASE_KINDS.reject { |phase| phase == "balloting" }.each do |phase|
budget.update(phase: phase)
investment = create(:budget_investment, budget: budget)
@@ -1215,7 +1215,7 @@ describe Budget::Investment do
let(:investment) { create(:budget_investment, budget: budget) }
describe "with without_admin filter" do
- let(:params) { {advanced_filters: ["without_admin"], budget_id: budget.id} }
+ let(:params) { { advanced_filters: ["without_admin"], budget_id: budget.id } }
it "returns only investment without admin" do
create(:budget_investment,
:finished,
@@ -1230,7 +1230,7 @@ describe Budget::Investment do
end
describe "with without_valuator filter" do
- let(:params) { {advanced_filters: ["without_valuator"], budget_id: budget.id} }
+ let(:params) { { advanced_filters: ["without_valuator"], budget_id: budget.id } }
it "returns only investment without valuator" do
create(:budget_investment,
:finished,
@@ -1248,7 +1248,7 @@ describe Budget::Investment do
end
describe "with under_valuation filter" do
- let(:params) { {advanced_filters: ["under_valuation"], budget_id: budget.id} }
+ let(:params) { { advanced_filters: ["under_valuation"], budget_id: budget.id } }
it "returns only investment under valuation" do
valuator1 = create(:valuator)
investment1 = create(:budget_investment,
@@ -1265,7 +1265,7 @@ describe Budget::Investment do
end
describe "with valuation_finished filter" do
- let(:params) { {advanced_filters: ["valuation_finished"], budget_id: budget.id} }
+ let(:params) { { advanced_filters: ["valuation_finished"], budget_id: budget.id } }
it "returns only investment with valuation finished" do
investment1 = create(:budget_investment,
:selected,
@@ -1281,7 +1281,7 @@ describe Budget::Investment do
end
describe "with winners filter" do
- let(:params) { {advanced_filters: ["winners"], budget_id: budget.id} }
+ let(:params) { { advanced_filters: ["winners"], budget_id: budget.id } }
it "returns only investment winners" do
investment1 = create(:budget_investment,
:winner,
@@ -1327,7 +1327,7 @@ describe Budget::Investment do
describe "milestone_tags" do
context "without milestone_tags" do
- let(:investment) {create(:budget_investment)}
+ let(:investment) { create(:budget_investment) }
it "do not have milestone_tags" do
expect(investment.milestone_tag_list).to eq([])
@@ -1342,7 +1342,7 @@ describe Budget::Investment do
end
context "with milestone_tags" do
- let(:investment) {create(:budget_investment, :with_milestone_tags)}
+ let(:investment) { create(:budget_investment, :with_milestone_tags) }
it "has milestone_tags" do
expect(investment.milestone_tag_list.count).to eq(1)
diff --git a/spec/models/budget/phase_spec.rb b/spec/models/budget/phase_spec.rb
index e1f32186d..e7ef5fa28 100644
--- a/spec/models/budget/phase_spec.rb
+++ b/spec/models/budget/phase_spec.rb
@@ -7,7 +7,7 @@ describe Budget::Phase do
let(:second_phase) { budget.phases.informing }
let(:third_phase) { budget.phases.accepting }
let(:fourth_phase) { budget.phases.reviewing }
- let(:final_phase) { budget.phases.finished}
+ let(:final_phase) { budget.phases.finished }
describe "validates" do
it "is not valid without a budget" do
@@ -136,17 +136,17 @@ describe Budget::Phase do
end
it "adjusts previous enabled phase end date to its own start date" do
- expect{
+ expect {
second_phase.update_attributes(enabled: true)
- }.to change{
+ }.to change {
prev_enabled_phase.ends_at.to_date
}.to(Date.current)
end
it "adjusts next enabled phase start date to its own end date" do
- expect{
+ expect {
second_phase.update_attributes(enabled: true)
- }.to change{
+ }.to change {
next_enabled_phase.starts_at.to_date
}.to(Date.current + 2.days)
end
@@ -161,14 +161,14 @@ describe Budget::Phase do
expect {
second_phase.update_attributes(starts_at: Date.current,
ends_at: Date.current + 2.days)
- }.not_to (change{ prev_enabled_phase.ends_at })
+ }.not_to (change { prev_enabled_phase.ends_at })
end
it "doesn't change next enabled phase start date" do
- expect{
+ expect {
second_phase.update_attributes(starts_at: Date.current,
ends_at: Date.current + 2.days)
- }.not_to (change{ next_enabled_phase.starts_at })
+ }.not_to (change { next_enabled_phase.starts_at })
end
end
@@ -178,7 +178,7 @@ describe Budget::Phase do
second_phase.update_attributes(enabled: false,
starts_at: Date.current,
ends_at: Date.current + 2.days)
- }.not_to (change{ prev_enabled_phase.ends_at })
+ }.not_to (change { prev_enabled_phase.ends_at })
end
it "adjusts next enabled phase start date to its own start date" do
@@ -186,7 +186,7 @@ describe Budget::Phase do
second_phase.update_attributes(enabled: false,
starts_at: Date.current,
ends_at: Date.current + 2.days)
- }.to change{ next_enabled_phase.starts_at.to_date }.to(Date.current)
+ }.to change { next_enabled_phase.starts_at.to_date }.to(Date.current)
end
end
end
@@ -215,9 +215,9 @@ describe Budget::Phase do
describe "#sanitize_description" do
it "removes not allowed html entities from the description" do
- expect{
+ expect {
first_phase.update_attributes(description: ' a ')
- }.to change{ first_phase.description }.to(' a javascript')
+ }.to change { first_phase.description }.to(' a javascript')
end
end
end
diff --git a/spec/models/concerns/sluggable.rb b/spec/models/concerns/sluggable.rb
index d1dd64720..71cce4779 100644
--- a/spec/models/concerns/sluggable.rb
+++ b/spec/models/concerns/sluggable.rb
@@ -15,15 +15,15 @@ shared_examples_for "sluggable" do |updatable_slug_trait:|
context "slug updating condition is true" do
it "slug is updated" do
updatable = create(factory_name, updatable_slug_trait, name: "Old Name")
- expect{updatable.update_attributes(name: "New Name")}
- .to change{ updatable.slug }.from("old-name").to("new-name")
+ expect { updatable.update_attributes(name: "New Name") }
+ .to change { updatable.slug }.from("old-name").to("new-name")
end
end
context "slug updating condition is false" do
it "slug isn't updated" do
- expect{sluggable.update_attributes(name: "New Name")}
- .not_to (change{ sluggable.slug })
+ expect { sluggable.update_attributes(name: "New Name") }
+ .not_to (change { sluggable.slug })
end
end
end
diff --git a/spec/models/debate_spec.rb b/spec/models/debate_spec.rb
index 2b6416284..2afd2f3c9 100644
--- a/spec/models/debate_spec.rb
+++ b/spec/models/debate_spec.rb
@@ -163,52 +163,52 @@ describe Debate do
describe "from level two verified users" do
it "registers vote" do
user = create(:user, residence_verified_at: Time.current, confirmed_phone: "666333111")
- expect {debate.register_vote(user, "yes")}.to change{debate.reload.votes_for.size}.by(1)
+ expect { debate.register_vote(user, "yes") }.to change { debate.reload.votes_for.size }.by(1)
end
it "does not increase anonymous votes counter " do
user = create(:user, residence_verified_at: Time.current, confirmed_phone: "666333111")
- expect {debate.register_vote(user, "yes")}.not_to change{debate.reload.cached_anonymous_votes_total}
+ expect { debate.register_vote(user, "yes") }.not_to change { debate.reload.cached_anonymous_votes_total }
end
end
describe "from level three verified users" do
it "registers vote" do
user = create(:user, verified_at: Time.current)
- expect {debate.register_vote(user, "yes")}.to change{debate.reload.votes_for.size}.by(1)
+ expect { debate.register_vote(user, "yes") }.to change { debate.reload.votes_for.size }.by(1)
end
it "does not increase anonymous votes counter " do
user = create(:user, verified_at: Time.current)
- expect {debate.register_vote(user, "yes")}.not_to change{debate.reload.cached_anonymous_votes_total}
+ expect { debate.register_vote(user, "yes") }.not_to change { debate.reload.cached_anonymous_votes_total }
end
end
describe "from anonymous users when anonymous votes are allowed" do
- before {debate.update(cached_anonymous_votes_total: 42, cached_votes_total: 100)}
+ before { debate.update(cached_anonymous_votes_total: 42, cached_votes_total: 100) }
it "registers vote" do
user = create(:user)
- expect {debate.register_vote(user, "yes")}.to change {debate.reload.votes_for.size}.by(1)
+ expect { debate.register_vote(user, "yes") }.to change { debate.reload.votes_for.size }.by(1)
end
it "increases anonymous votes counter" do
user = create(:user)
- expect {debate.register_vote(user, "yes")}.to change {debate.reload.cached_anonymous_votes_total}.by(1)
+ expect { debate.register_vote(user, "yes") }.to change { debate.reload.cached_anonymous_votes_total }.by(1)
end
end
describe "from anonymous users when there are too many anonymous votes" do
- before {debate.update(cached_anonymous_votes_total: 520, cached_votes_total: 1000)}
+ before { debate.update(cached_anonymous_votes_total: 520, cached_votes_total: 1000) }
it "does not register vote " do
user = create(:user)
- expect {debate.register_vote(user, "yes")}.not_to change {debate.reload.votes_for.size}
+ expect { debate.register_vote(user, "yes") }.not_to change { debate.reload.votes_for.size }
end
it "does not increase anonymous votes counter " do
user = create(:user)
- expect {debate.register_vote(user, "yes")}.not_to change {debate.reload.cached_anonymous_votes_total}
+ expect { debate.register_vote(user, "yes") }.not_to change { debate.reload.cached_anonymous_votes_total }
end
end
end
diff --git a/spec/models/flag_spec.rb b/spec/models/flag_spec.rb
index 30a69acec..23683011d 100644
--- a/spec/models/flag_spec.rb
+++ b/spec/models/flag_spec.rb
@@ -8,7 +8,7 @@ describe Flag do
describe ".flag" do
it "creates a flag when there is none" do
- expect { described_class.flag(user, comment) }.to change{ described_class.count }.by(1)
+ expect { described_class.flag(user, comment) }.to change { described_class.count }.by(1)
expect(described_class.last.user).to eq(user)
expect(described_class.last.flaggable).to eq(comment)
end
@@ -20,7 +20,7 @@ describe Flag do
end
it "increases the flag count" do
- expect { described_class.flag(user, comment) }.to change{ comment.reload.flags_count }.by(1)
+ expect { described_class.flag(user, comment) }.to change { comment.reload.flags_count }.by(1)
end
end
@@ -33,11 +33,11 @@ describe Flag do
before { described_class.flag(user, comment) }
it "removes an existing flag" do
- expect { described_class.unflag(user, comment) }.to change{ described_class.count }.by(-1)
+ expect { described_class.unflag(user, comment) }.to change { described_class.count }.by(-1)
end
it "decreases the flag count" do
- expect { described_class.unflag(user, comment) }.to change{ comment.reload.flags_count }.by(-1)
+ expect { described_class.unflag(user, comment) }.to change { comment.reload.flags_count }.by(-1)
end
end
end
diff --git a/spec/models/i18n_content_spec.rb b/spec/models/i18n_content_spec.rb
index f412d2946..9634b986a 100644
--- a/spec/models/i18n_content_spec.rb
+++ b/spec/models/i18n_content_spec.rb
@@ -74,7 +74,7 @@ RSpec.describe I18nContent, type: :model do
"w" => "string"
})
- expect(I18nContent.flat_hash({ w: { p: "string" } })).to eq({
+ expect(I18nContent.flat_hash({ w: { p: "string" }})).to eq({
"w.p" => "string"
})
end
@@ -92,7 +92,7 @@ RSpec.describe I18nContent, type: :model do
"f.w" => "string"
})
- expect(I18nContent.flat_hash({ w: { p: "string" } }, "f")).to eq({
+ expect(I18nContent.flat_hash({ w: { p: "string" }}, "f")).to eq({
"f.w.p" => "string"
})
end
@@ -112,7 +112,7 @@ RSpec.describe I18nContent, type: :model do
"w" => "string"
})
- expect(I18nContent.flat_hash({w: { p: "string" } }, nil, { q: "other string" })).to eq({
+ expect(I18nContent.flat_hash({ w: { p: "string" }}, nil, { q: "other string" })).to eq({
q: "other string",
"w.p" => "string"
})
@@ -133,7 +133,7 @@ RSpec.describe I18nContent, type: :model do
"f.w" => "string"
})
- expect(I18nContent.flat_hash({ w: { p: "string" } }, "f", { q: "other string" })).to eq({
+ expect(I18nContent.flat_hash({ w: { p: "string" }}, "f", { q: "other string" })).to eq({
q: "other string",
"f.w.p" => "string"
})
diff --git a/spec/models/legislation/annotation_spec.rb b/spec/models/legislation/annotation_spec.rb
index 676137716..965eac3e8 100644
--- a/spec/models/legislation/annotation_spec.rb
+++ b/spec/models/legislation/annotation_spec.rb
@@ -24,7 +24,7 @@ RSpec.describe Legislation::Annotation, type: :model do
annotation = create(:legislation_annotation,
draft_version: draft_version,
quote: quote,
- ranges: [{"start" => "/p[1]", "startOffset" => 6, "end" => "/p[3]", "endOffset" => 11}]
+ ranges: [{ "start" => "/p[1]", "startOffset" => 6, "end" => "/p[3]", "endOffset" => 11 }]
)
context = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt"\
@@ -49,7 +49,7 @@ RSpec.describe Legislation::Annotation, type: :model do
annotation = create(:legislation_annotation,
draft_version: draft_version,
quote: quote,
- ranges: [{"start" => "/p[1]", "startOffset" => 273, "end" => "/p[2]", "endOffset" => 190}]
+ ranges: [{ "start" => "/p[1]", "startOffset" => 273, "end" => "/p[2]", "endOffset" => 190 }]
)
context = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna"\
@@ -95,7 +95,7 @@ RSpec.describe Legislation::Annotation, type: :model do
annotation = create(:legislation_annotation,
draft_version: draft_version,
quote: quote,
- ranges: [{"start" => "/p[2]", "startOffset" => 127, "end" => "/p[3]", "endOffset" => 223}]
+ ranges: [{ "start" => "/p[2]", "startOffset" => 127, "end" => "/p[3]", "endOffset" => 223 }]
)
context = "The licenses for most software and other practical works are designed to take away your freedom to share and change the"\
diff --git a/spec/models/legislation/process_spec.rb b/spec/models/legislation/process_spec.rb
index aca03281c..787199fc3 100644
--- a/spec/models/legislation/process_spec.rb
+++ b/spec/models/legislation/process_spec.rb
@@ -198,7 +198,7 @@ describe Legislation::Process do
describe "milestone_tags" do
context "without milestone_tags" do
- let(:process) {create(:legislation_process)}
+ let(:process) { create(:legislation_process) }
it "do not have milestone_tags" do
expect(process.milestone_tag_list).to eq([])
@@ -214,7 +214,7 @@ describe Legislation::Process do
context "with milestone_tags" do
- let(:process) {create(:legislation_process, :with_milestone_tags)}
+ let(:process) { create(:legislation_process, :with_milestone_tags) }
it "has milestone_tags" do
expect(process.milestone_tag_list.count).to eq(1)
diff --git a/spec/models/poll/ballot_spec.rb b/spec/models/poll/ballot_spec.rb
index 021bd53b6..8e449a533 100644
--- a/spec/models/poll/ballot_spec.rb
+++ b/spec/models/poll/ballot_spec.rb
@@ -2,10 +2,10 @@ require "rails_helper"
describe Poll::Ballot do
- let(:budget){ create(:budget) }
- let(:group){ create(:budget_group, budget: budget) }
- let(:heading){ create(:budget_heading, group: group, price: 10000000) }
- let(:investment){ create(:budget_investment, :selected, price: 5000000, heading: heading) }
+ let(:budget) { create(:budget) }
+ let(:group) { create(:budget_group, budget: budget) }
+ let(:heading) { create(:budget_heading, group: group, price: 10000000) }
+ let(:investment) { create(:budget_investment, :selected, price: 5000000, heading: heading) }
let(:poll) { create(:poll, budget: budget) }
let(:poll_ballot_sheet) { create(:poll_ballot_sheet, poll: poll) }
let(:poll_ballot) { create(:poll_ballot, ballot_sheet: poll_ballot_sheet, external_id: 1, data: investment.id) }
diff --git a/spec/models/poll/booth_assignment_spec.rb b/spec/models/poll/booth_assignment_spec.rb
index 2ed3a4507..7d9ce3e26 100644
--- a/spec/models/poll/booth_assignment_spec.rb
+++ b/spec/models/poll/booth_assignment_spec.rb
@@ -1,9 +1,9 @@
require "rails_helper"
describe Poll::BoothAssignment do
- let(:poll){create(:poll)}
- let(:booth){create(:poll_booth)}
- let(:booth1){create(:poll_booth)}
+ let(:poll) { create(:poll) }
+ let(:booth) { create(:poll_booth) }
+ let(:booth1) { create(:poll_booth) }
it "checks if there are shifts" do
assignment_with_shifts = create(:poll_booth_assignment, poll: poll, booth: booth)
diff --git a/spec/models/poll/poll_spec.rb b/spec/models/poll/poll_spec.rb
index 86b2f8528..6b816f9bf 100644
--- a/spec/models/poll/poll_spec.rb
+++ b/spec/models/poll/poll_spec.rb
@@ -139,7 +139,7 @@ describe Poll do
end
describe "answerable_by" do
- let(:geozone) {create(:geozone) }
+ let(:geozone) { create(:geozone) }
let!(:current_poll) { create(:poll) }
let!(:expired_poll) { create(:poll, :expired) }
@@ -429,7 +429,7 @@ describe Poll do
end
it "is false for polls which finished less than a month ago" do
- poll = create(:poll, starts_at: 3.months.ago, ends_at: 27.days.ago )
+ poll = create(:poll, starts_at: 3.months.ago, ends_at: 27.days.ago)
expect(poll.recounts_confirmed?).to be false
end
diff --git a/spec/models/poll/shift_spec.rb b/spec/models/poll/shift_spec.rb
index 082e0e4c2..932e0cc25 100644
--- a/spec/models/poll/shift_spec.rb
+++ b/spec/models/poll/shift_spec.rb
@@ -63,7 +63,7 @@ describe Poll::Shift do
booth_assignment1 = create(:poll_booth_assignment, poll: poll, booth: booth)
booth_assignment2 = create(:poll_booth_assignment, poll: poll2, booth: booth)
- expect { create(:poll_shift, booth: booth, officer: officer, date: Date.current) }.to change {Poll::OfficerAssignment.all.count}.by(2)
+ expect { create(:poll_shift, booth: booth, officer: officer, date: Date.current) }.to change { Poll::OfficerAssignment.all.count }.by(2)
officer_assignments = Poll::OfficerAssignment.all
oa1 = officer_assignments.first
@@ -81,7 +81,7 @@ describe Poll::Shift do
create(:poll_officer_assignment, officer: officer, booth_assignment: booth_assignment1, date: Date.tomorrow)
- expect { described_class.last.destroy }.to change {Poll::OfficerAssignment.all.count}.by(-2)
+ expect { described_class.last.destroy }.to change { Poll::OfficerAssignment.all.count }.by(-2)
end
it "creates final officer_assignments" do
diff --git a/spec/models/proposal_spec.rb b/spec/models/proposal_spec.rb
index f2661987a..17fe65682 100644
--- a/spec/models/proposal_spec.rb
+++ b/spec/models/proposal_spec.rb
@@ -177,8 +177,8 @@ describe Proposal do
describe "#editable?" do
let(:proposal) { create(:proposal) }
- before {Setting["max_votes_for_proposal_edit"] = 5}
- after {Setting["max_votes_for_proposal_edit"] = 1000}
+ before { Setting["max_votes_for_proposal_edit"] = 5 }
+ after { Setting["max_votes_for_proposal_edit"] = 1000 }
it "is true if proposal has no votes yet" do
expect(proposal.total_votes).to eq(0)
@@ -223,21 +223,21 @@ describe Proposal do
describe "from level two verified users" do
it "registers vote" do
user = create(:user, residence_verified_at: Time.current, confirmed_phone: "666333111")
- expect {proposal.register_vote(user, "yes")}.to change{proposal.reload.votes_for.size}.by(1)
+ expect { proposal.register_vote(user, "yes") }.to change { proposal.reload.votes_for.size }.by(1)
end
end
describe "from level three verified users" do
it "registers vote" do
user = create(:user, verified_at: Time.current)
- expect {proposal.register_vote(user, "yes")}.to change{proposal.reload.votes_for.size}.by(1)
+ expect { proposal.register_vote(user, "yes") }.to change { proposal.reload.votes_for.size }.by(1)
end
end
describe "from anonymous users" do
it "does not register vote" do
user = create(:user)
- expect {proposal.register_vote(user, "yes")}.to change{proposal.reload.votes_for.size}.by(0)
+ expect { proposal.register_vote(user, "yes") }.to change { proposal.reload.votes_for.size }.by(0)
end
end
@@ -245,7 +245,7 @@ describe Proposal do
user = create(:user, verified_at: Time.current)
archived_proposal = create(:proposal, :archived)
- expect {archived_proposal.register_vote(user, "yes")}.to change{proposal.reload.votes_for.size}.by(0)
+ expect { archived_proposal.register_vote(user, "yes") }.to change { proposal.reload.votes_for.size }.by(0)
end
end
@@ -1031,7 +1031,7 @@ describe Proposal do
end
it "does not return proposals when user is follower" do
- proposal1 = create(:proposal, tag_list: "Sport")
+ proposal1 = create(:proposal, tag_list: "Sport")
create(:follow, followable: proposal1, user: user)
result = described_class.recommendations(user)
@@ -1144,7 +1144,7 @@ describe Proposal do
context "without milestone_tags" do
- let(:proposal) {create(:proposal)}
+ let(:proposal) { create(:proposal) }
it "do not have milestone_tags" do
expect(proposal.milestone_tag_list).to eq([])
@@ -1160,7 +1160,7 @@ describe Proposal do
context "with milestone_tags" do
- let(:proposal) {create(:proposal, :with_milestone_tags)}
+ let(:proposal) { create(:proposal, :with_milestone_tags) }
it "has milestone_tags" do
expect(proposal.milestone_tag_list.count).to eq(1)
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index d11df7760..42cb51093 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -252,7 +252,7 @@ describe User do
end
describe "organization_attributes" do
- before { subject.organization_attributes = {name: "org", responsible_name: "julia"} }
+ before { subject.organization_attributes = { name: "org", responsible_name: "julia" } }
it "triggers the creation of an associated organization" do
expect(subject.organization).to be
@@ -461,18 +461,18 @@ describe User do
it "expires cache with becoming a moderator" do
expect { create(:moderator, user: user) }
- .to change { user.updated_at}
+ .to change { user.updated_at }
end
it "expires cache with becoming an admin" do
expect { create(:administrator, user: user) }
- .to change { user.updated_at}
+ .to change { user.updated_at }
end
it "expires cache with becoming a veridied organization" do
create(:organization, user: user)
expect { user.organization.verify }
- .to change { user.reload.updated_at}
+ .to change { user.reload.updated_at }
end
end
diff --git a/spec/shared/features/documentable.rb b/spec/shared/features/documentable.rb
index 64387420d..8d03151ca 100644
--- a/spec/shared/features/documentable.rb
+++ b/spec/shared/features/documentable.rb
@@ -1,6 +1,4 @@
-shared_examples "documentable" do |documentable_factory_name,
- documentable_path,
- documentable_path_arguments|
+shared_examples "documentable" do |documentable_factory_name, documentable_path, documentable_path_arguments|
include ActionView::Helpers
let(:administrator) { create(:user) }
diff --git a/spec/shared/features/imageable_destroy.rb b/spec/shared/features/imageable_destroy.rb
index dc8d7d62c..f1ccd7c07 100644
--- a/spec/shared/features/imageable_destroy.rb
+++ b/spec/shared/features/imageable_destroy.rb
@@ -1,6 +1,4 @@
-shared_examples "imageable destroy" do |imageable_factory_name,
- imageable_path,
- imageable_path_arguments|
+shared_examples "imageable destroy" do |imageable_factory_name, imageable_path, imageable_path_arguments|
include ActionView::Helpers
include ImagesHelper
include ImageablesHelper
diff --git a/spec/shared/features/mappable.rb b/spec/shared/features/mappable.rb
index 1f211c9e6..5e827050d 100644
--- a/spec/shared/features/mappable.rb
+++ b/spec/shared/features/mappable.rb
@@ -1,10 +1,4 @@
-shared_examples "mappable" do |mappable_factory_name,
- mappable_association_name,
- mappable_new_path,
- mappable_edit_path,
- mappable_show_path,
- mappable_path_arguments,
- management = false|
+shared_examples "mappable" do |mappable_factory_name, mappable_association_name, mappable_new_path, mappable_edit_path, mappable_show_path, mappable_path_arguments, management = false|
include ActionView::Helpers
diff --git a/spec/shared/features/nested_documentable.rb b/spec/shared/features/nested_documentable.rb
index a70e29d5f..702b3226a 100644
--- a/spec/shared/features/nested_documentable.rb
+++ b/spec/shared/features/nested_documentable.rb
@@ -1,7 +1,4 @@
-shared_examples "nested documentable" do |login_as_name, documentable_factory_name,
- path, documentable_path_arguments,
- fill_resource_method_name, submit_button,
- documentable_success_notice|
+shared_examples "nested documentable" do |login_as_name, documentable_factory_name, path, documentable_path_arguments, fill_resource_method_name, submit_button, documentable_success_notice|
include ActionView::Helpers
include DocumentsHelper
include DocumentablesHelper
@@ -14,7 +11,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
else
let!(:documentable) { create(documentable_factory_name, author: user) }
end
- let!(:user_to_login) { send(login_as_name)}
+ let!(:user_to_login) { send(login_as_name) }
before do
create(:administrator, user: administrator)
diff --git a/spec/shared/features/nested_imageable.rb b/spec/shared/features/nested_imageable.rb
index e84c7e2ba..e2317ade5 100644
--- a/spec/shared/features/nested_imageable.rb
+++ b/spec/shared/features/nested_imageable.rb
@@ -1,7 +1,4 @@
-shared_examples "nested imageable" do |imageable_factory_name, path,
- imageable_path_arguments, fill_resource_method_name,
- submit_button, imageable_success_notice,
- has_many_images = false|
+shared_examples "nested imageable" do |imageable_factory_name, path, imageable_path_arguments, fill_resource_method_name, submit_button, imageable_success_notice, has_many_images = false|
include ActionView::Helpers
include ImagesHelper
include ImageablesHelper
diff --git a/spec/shared/models/acts_as_imageable.rb b/spec/shared/models/acts_as_imageable.rb
index 8186283c8..53371b17c 100644
--- a/spec/shared/models/acts_as_imageable.rb
+++ b/spec/shared/models/acts_as_imageable.rb
@@ -71,7 +71,7 @@ shared_examples "acts as imageable" do |imageable_factory|
image_url = image.attachment.url
new_url = "/attachments/original/missing.png"
- expect{ image.attachment.destroy }.to change{ image.attachment.url }.from(image_url).to(new_url)
+ expect { image.attachment.destroy }.to change { image.attachment.url }.from(image_url).to(new_url)
end
end
diff --git a/spec/shared/models/acts_as_paranoid.rb b/spec/shared/models/acts_as_paranoid.rb
index ee88d13a8..63c392915 100644
--- a/spec/shared/models/acts_as_paranoid.rb
+++ b/spec/shared/models/acts_as_paranoid.rb
@@ -22,14 +22,14 @@ shared_examples "acts as paranoid" do |factory_name|
end
it "should be destroyed after parent resource really_destroy" do
- expect{ resource.really_destroy! }.to change { resource.translations.with_deleted.count }.from(1).to(0)
+ expect { resource.really_destroy! }.to change { resource.translations.with_deleted.count }.from(1).to(0)
end
it "cannot be recovered through non recursive restore" do
resource.destroy
resource.reload
- expect{ resource.restore }.not_to change { resource.translations.with_deleted.first.hidden_at }
+ expect { resource.restore }.not_to change { resource.translations.with_deleted.first.hidden_at }
end
it "can be recovered through recursive restore after non-recursive restore" do
@@ -38,7 +38,7 @@ shared_examples "acts as paranoid" do |factory_name|
resource.destroy
resource.reload
- expect{ resource.restore(recursive: true) }.to change { resource.translations.with_deleted.first.hidden_at }
+ expect { resource.restore(recursive: true) }.to change { resource.translations.with_deleted.first.hidden_at }
end
it "can be recovered after soft deletion through recursive restore" do
diff --git a/spec/support/verifiable.rb b/spec/support/verifiable.rb
index 4a8c5a90e..2558a8a1c 100644
--- a/spec/support/verifiable.rb
+++ b/spec/support/verifiable.rb
@@ -181,7 +181,7 @@ shared_examples_for "verifiable" do
describe "methods modified by Setting user.skip_verification" do
- let(:user) {create(:user)}
+ let(:user) { create(:user) }
before do
Setting["feature.user.skip_verification"] = "true"
diff --git a/spec/views/welcome/index.html.erb_spec.rb b/spec/views/welcome/index.html.erb_spec.rb
index d5a3a1683..64cedc3e3 100644
--- a/spec/views/welcome/index.html.erb_spec.rb
+++ b/spec/views/welcome/index.html.erb_spec.rb
@@ -13,7 +13,7 @@ RSpec.describe "welcome#index" do
image_default: "https://dummyimage.com/600x400/000/fff",
carousel_size: "medium-6 large-6 medium-centered large-centered",
btn_text_link: t("welcome.recommended.debates.btn_text_link"),
- btn_path_link: debates_path(order: "recommendations")}
+ btn_path_link: debates_path(order: "recommendations") }
within 'li[data-slide="0"] .card' do
expect(page).to have_selector("img")
@@ -32,7 +32,7 @@ RSpec.describe "welcome#index" do
image_default: nil,
carousel_size: "medium-6 large-6 medium-centered large-centered",
btn_text_link: t("welcome.recommended.debates.btn_text_link"),
- btn_path_link: debates_path(order: "recommendations")}
+ btn_path_link: debates_path(order: "recommendations") }
within 'li[data-slide="0"] .card' do
expect(page).not_to have_selector("img")
|