Merge pull request #4102 from consul/dependabot/bundler/erb_lint-0.0.35

Apply Rubocop rules in ERB files
This commit is contained in:
Javi Martín
2021-02-08 15:39:27 +01:00
committed by GitHub
59 changed files with 96 additions and 121 deletions

View File

@@ -1,11 +1,15 @@
---
linters:
ClosingErbTagIndent:
enabled: true
ErbSafety:
enabled: true
ExtraNewline:
enabled: true
FinalNewline:
enabled: true
NoJavascriptTagHelper:
enabled: true
SelfClosingTag:
enabled: false
SpaceAroundErbTag:
@@ -18,29 +22,14 @@ linters:
enabled: true
Rubocop:
enabled: true
only:
- Layout/EndOfLine
- Layout/SpaceAfterColon
- Layout/SpaceAfterComma
- Layout/SpaceAfterMethodName
- Layout/SpaceAfterNot
- Layout/SpaceAfterSemicolon
- Layout/SpaceAroundBlockParameters
- Layout/SpaceAroundOperators
- Layout/SpaceBeforeBlockBraces
- Layout/SpaceBeforeComma
- Layout/SpaceBeforeComment
- Layout/SpaceBeforeFirstArg
- Layout/SpaceBeforeSemicolon
- Layout/SpaceInsideArrayLiteralBrackets
- Layout/SpaceInsideArrayPercentLiteral
- Layout/SpaceInsideBlockBraces
- Layout/SpaceInsideHashLiteralBraces
- Layout/SpaceInsideParens
- Layout/SpaceInsidePercentLiteralDelimiters
- Layout/SpaceInsideRangeLiteral
- Layout/SpaceInsideReferenceBrackets
- Layout/SpaceInsideStringInterpolation
- Layout/Tab
- Lint/LiteralAsCondition
- Style/PercentLiteralDelimiters
rubocop_config:
inherit_from:
- .rubocop.yml
Layout/LineLength:
Enabled: false
Layout/TrailingEmptyLines:
Enabled: false
Lint/UselessAssignment:
Enabled: false
Rails/OutputSafety:
Enabled: false

View File

@@ -99,7 +99,7 @@ group :development do
gem "capistrano-rails", "~> 1.6.1", require: false
gem "capistrano3-delayed-job", "~> 1.7.6"
gem "capistrano3-puma", "~> 4.0.0"
gem "erb_lint", require: false
gem "erb_lint", "~> 0.0.35", require: false
gem "github_changelog_generator", "~> 1.15.2"
gem "mdl", "~> 0.11.0", require: false
gem "rubocop", "~> 0.91.0", require: false

View File

@@ -80,7 +80,7 @@ GEM
babel-source (>= 4.0, < 6)
execjs (~> 2.0)
bcrypt (3.1.16)
better_html (1.0.13)
better_html (1.0.15)
actionview (>= 4.0)
activesupport (>= 4.0)
ast (~> 2.0)
@@ -208,12 +208,13 @@ GEM
htmlentities (~> 4.3.3)
launchy (~> 2.1)
mail (~> 2.7)
erb_lint (0.0.28)
erb_lint (0.0.35)
activesupport
better_html (~> 1.0.7)
html_tokenizer
parser (>= 2.7.1.4)
rainbow
rubocop (~> 0.51)
rubocop (~> 0.79)
smart_properties
errbase (0.0.3)
erubi (1.9.0)
@@ -555,7 +556,7 @@ GEM
simplecov-html (0.10.2)
sitemap_generator (6.1.2)
builder (~> 3.0)
smart_properties (1.13.1)
smart_properties (1.15.0)
social-share-button (1.1.0)
coffee-rails
socksify (1.7.1)
@@ -670,7 +671,7 @@ DEPENDENCIES
devise-async (~> 1.0.0)
devise-security (~> 0.11.1)
email_spec (~> 2.2.0)
erb_lint
erb_lint (~> 0.0.35)
factory_bot_rails (~> 4.8.2)
faker (~> 1.8.7)
font-awesome-sass (~> 5.15.1)

View File

@@ -77,7 +77,7 @@ class Admin::SiteCustomization::ContentBlocksController < Admin::SiteCustomizati
if @content_block.is_a? Budget::ContentBlock
@selected_content_block = "hcb_#{@content_block.heading_id}"
else
@selected_content_block = @content_block.heading.name
@selected_content_block = @content_block.name
end
@is_heading_content_block = true
render :edit

View File

@@ -4,5 +4,6 @@ class Budget
validates :heading, presence: true, uniqueness: { scope: :locale }
belongs_to :heading
delegate :name, to: :heading, allow_nil: true
end
end

View File

@@ -52,7 +52,7 @@
<div class="small-12 medium-6">
<%= f.select(:administrator_id,
@admins.collect { |a| [a.description_or_name_and_email, a.id] },
@admins.map { |a| [a.description_or_name_and_email, a.id] },
{ include_blank: t("admin.budget_investments.edit.undefined") }) %>
</div>
</div>

View File

@@ -25,7 +25,7 @@
<h2 id="classification"><%= t("admin.budget_investments.show.classification") %></h2>
<p><strong><%= t("admin.budget_investments.show.assigned_admin") %>:</strong>
<%= @investment.administrator.try(:name_and_email) || t("admin.budget_investments.show.undefined") %>
<%= @investment.administrator&.name_and_email || t("admin.budget_investments.show.undefined") %>
</p>
<p id="tags">
@@ -37,7 +37,7 @@
<p id="assigned_valuator_groups">
<strong><%= t("admin.budget_investments.show.valuator_groups") %>:</strong>
<% if @investment.valuator_groups.any? %>
<%= @investment.valuator_groups.collect(&:name).join(", ") %>
<%= @investment.valuator_groups.map(&:name).join(", ") %>
<% else %>
<%= t("admin.budget_investments.show.undefined") %>
<% end %>
@@ -46,7 +46,7 @@
<p id="assigned_valuators">
<strong><%= t("admin.budget_investments.show.assigned_valuators") %>:</strong>
<% if @investment.valuators.any? %>
<%= @investment.valuators.collect(&:name_and_email).join(", ") %>
<%= @investment.valuators.map(&:name_and_email).join(", ") %>
<% else %>
<%= t("admin.budget_investments.show.undefined") %>
<% end %>

View File

@@ -36,4 +36,4 @@
<% end %>
</table>
<%= paginate [@debates, @comments].sort_by { |x| x.size }.last %>
<%= paginate [@debates, @comments].sort_by(&:size).last %>

View File

@@ -5,7 +5,7 @@
<div class="row">
<div class="small-12 medium-6 margin-bottom column">
<%= f.select :status_id,
@statuses.collect { |s| [s.name, s.id] },
@statuses.map { |s| [s.name, s.id] },
{ include_blank: @statuses.any? ? "" : t("admin.milestones.form.no_statuses_defined") },
{ disabled: @statuses.blank? } %>
<%= link_to t("admin.milestones.form.admin_statuses"),

View File

@@ -22,7 +22,7 @@
</thead>
<tbody>
<% @organizations.each do |organization| %>
<% hidden += 1 and next if organization.user.nil? || organization.user.hidden? %>
<% hidden += 1 and next if organization.user.nil? %>
<tr id="<%= dom_id(organization) %>">
<td><%= organization.name %></td>
<td><%= organization.email %></td>

View File

@@ -21,7 +21,7 @@
<% if feature.enabled? %>
<span class="enabled">
<strong>
<%= t ("admin.settings.index.features.enabled") %>
<%= t("admin.settings.index.features.enabled") %>
</strong>
</span>
<% else %>

View File

@@ -17,9 +17,9 @@
<%= form_tag admin_update_map_path, method: :put, id: "map-form" do |f| %>
<%= hidden_field_tag :latitude, Setting["map.latitude"] %>
<%= hidden_field_tag :longitude, Setting["map.longitude"] %>
<%= hidden_field_tag :zoom, Setting["map.zoom"] %>
<%= hidden_field_tag :latitude, Setting["map.latitude"] %>
<%= hidden_field_tag :longitude, Setting["map.longitude"] %>
<%= hidden_field_tag :zoom, Setting["map.zoom"] %>
<div class="small-12 medium-6 large-4 margin-top">
<%= submit_tag t("admin.settings.index.map.form.submit"),

View File

@@ -7,8 +7,7 @@
<%= select_tag :heading_id,
options_for_select(budget_heading_select_options(@budget),
params[:heading_id]),
include_blank: true
%>
include_blank: true %>
</div>
</div>
<div class="row">

View File

@@ -1,5 +1,5 @@
<% provide :title do %>
<%= t("admin.header.title") %> - <%= t("admin.menu.site_customization.content_blocks") %> - <%= @content_block.try(:name) || @content_block.heading.try(:name) %> (<%= @content_block.locale %>)
<%= t("admin.header.title") %> - <%= t("admin.menu.site_customization.content_blocks") %> - <%= @content_block.name %> (<%= @content_block.locale %>)
<% end %>
<%= back_link_to admin_site_customization_content_blocks_path %>

View File

@@ -43,7 +43,7 @@
<% end %>
<% @headings_content_blocks.each do |content_block| %>
<tr id="<%= dom_id(content_block) %>">
<td><%= link_to "#{content_block.heading.name} (#{content_block.locale})", admin_site_customization_edit_heading_content_block_path(content_block) %></td>
<td><%= link_to "#{content_block.name} (#{content_block.locale})", admin_site_customization_edit_heading_content_block_path(content_block) %></td>
<td><%= raw content_block.body %></td>
<td>
<%= render Admin::TableActionsComponent.new(

View File

@@ -2,7 +2,7 @@
<% information_texts_tabs.each do |tab| %>
<li class="tabs-title">
<% if tab.to_s == @tab %>
<%= link_to t("admin.menu.site_customization.information_texts_menu.#{tab}"), admin_site_customization_information_texts_path(tab: tab), :class => "is-active" %>
<%= link_to t("admin.menu.site_customization.information_texts_menu.#{tab}"), admin_site_customization_information_texts_path(tab: tab), class: "is-active" %>
<% else %>
<%= link_to t("admin.menu.site_customization.information_texts_menu.#{tab}"), admin_site_customization_information_texts_path(tab: tab) %>
<% end %>

View File

@@ -10,7 +10,7 @@
</td>
<td>
<% if valuator.valuator_group.present? %>
<%= valuator.valuator_group.try(:name) %>
<%= valuator.valuator_group&.name %>
<% else %>
<%= t("admin.valuators.index.no_group") %>
<% end %>

View File

@@ -4,7 +4,7 @@
<div class="row column">
<div class="small-12 medium-8 column">
<%= f.select :heading_id, budget_heading_select_options(@budget), { include_blank: true, } %>
<%= f.select :heading_id, budget_heading_select_options(@budget), { include_blank: true } %>
</div>
<div class="row">
<div class="small-12 column">

View File

@@ -63,8 +63,7 @@
<%= render "/budgets/investments/votes",
investment: investment,
investment_votes: investment_votes,
vote_url: namespaced_budget_investment_vote_path(investment, value: "yes")
%>
vote_url: namespaced_budget_investment_vote_path(investment, value: "yes") %>
</div>
<% elsif investment.should_show_vote_count? %>
<div id="<%= dom_id(investment) %>_votes"
@@ -84,8 +83,7 @@
<%= render "/budgets/investments/ballot",
investment: investment,
investment_ids: investment_ids,
ballot: ballot
%>
ballot: ballot %>
</div>
<% elsif investment.should_show_price? %>
<div id="<%= dom_id(investment) %>_price"

View File

@@ -34,8 +34,7 @@
<%= render "/budgets/investments/votes",
investment: investment,
investment_votes: investment_votes,
vote_url: vote_budget_investment_path(investment.budget, investment, value: "yes")
%>
vote_url: vote_budget_investment_path(investment.budget, investment, value: "yes") %>
</div>
</div>
<% elsif investment.should_show_vote_count? %>

View File

@@ -50,8 +50,7 @@
image_url: image_absolute_url(investment.image, :thumb),
url: budget_investment_url(investment.budget, investment),
description: investment.title,
mobile: investment.title
%>
mobile: investment.title %>
</div>
<% end %>
</div>

View File

@@ -7,8 +7,7 @@
investment: @investment,
investment_ids: @investment_ids,
investment_votes: @investment_votes,
ballot: @ballot
%>
ballot: @ballot %>
<div class="row">
<div class="small-12 column">

View File

@@ -61,8 +61,7 @@
title: @debate.title,
url: debate_url(@debate),
description: @debate.title,
mobile: @debate.title
%>
mobile: @debate.title %>
</aside>
</div>
</div>

View File

@@ -1,6 +1,6 @@
<h2><%= t("devise.password_expired.expire_password") %></h2>
<%= form_for(resource, :as => resource_name, :url => [resource_name, :password_expired], :html => { :method => :put }) do |f| %>
<%= form_for(resource, as: resource_name, url: [resource_name, :password_expired], html: { method: :put }) do |f| %>
<%= f.password_field :current_password %></p>
<%= f.password_field :password, label: t("devise.password_expired.new_password") %></p>

View File

@@ -1,3 +1,3 @@
<li>
<%= link_to t("views.pagination.first"), url, :remote => remote %>
<%= link_to t("views.pagination.first"), url, remote: remote %>
</li>

View File

@@ -1,3 +1,3 @@
<li>
<%= link_to t("views.pagination.last"), url, :remote => remote %>
<%= link_to t("views.pagination.last"), url, remote: remote %>
</li>

View File

@@ -1,3 +1,3 @@
<li class="pagination-next">
<%= link_to t("views.pagination.next"), url, :rel => "next", :remote => remote %>
<%= link_to t("views.pagination.next"), url, rel: "next", remote: remote %>
</li>

View File

@@ -5,6 +5,6 @@
</li>
<% else %>
<li>
<%= link_to page, url, { :remote => remote, :rel => page.next? ? "next" : page.prev? ? "prev" : nil } %>
<%= link_to page, url, { remote: remote, rel: page.next? ? "next" : page.prev? ? "prev" : nil } %>
</li>
<% end %>

View File

@@ -1,3 +1,3 @@
<li class="pagination-previous">
<%= link_to t("views.pagination.previous"), url, :rel => "prev", :remote => remote %>
<%= link_to t("views.pagination.previous"), url, rel: "prev", remote: remote %>
</li>

View File

@@ -6,4 +6,3 @@
<%= javascript_include_tag "application", "data-turbolinks-track" => "reload" %>
<%= csrf_meta_tags %>
<%= favicon_link_tag "favicon.ico" %>
<%= render "layouts/disable_animations_in_tests" if Rails.env.test? %>

View File

@@ -1,8 +0,0 @@
<%= javascript_tag "jQuery.fx.off = true" %>
<style>
* {
transition: none !important;
animation-duration: 0s !important;
animation-delay: 0s !important;
}
</style>

View File

@@ -1,5 +1,5 @@
<% if current_user.poll_officer? %>
<div id="officing-booth" class="callout info">
<%= t("admin.officing_booth.title", booth: try(:current_booth).try(:location)) %>
<%= t("admin.officing_booth.title", booth: try(:current_booth)&.location) %>
</div>
<% end %>

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="<%= I18n.locale %>" data-current-user-id="<%= current_user.try(:id) %>">
<html lang="<%= I18n.locale %>" data-current-user-id="<%= current_user&.id %>">
<head>
<%= render "layouts/common_head", default_title: setting["org_name"] %>
<%= render "layouts/tracking_data" %>

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="<%= I18n.locale %>" data-current-user-id="<%= current_user.try(:id) %>">
<html lang="<%= I18n.locale %>" data-current-user-id="<%= current_user&.id %>">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

View File

@@ -20,7 +20,6 @@
<h2><%= t("legislation.shared.share") %></h2>
<%= render "/shared/social_share",
title: t("legislation.shared.share_comment", version_name: @draft_version.title.downcase, process_name: @process.title),
url: legislation_process_draft_version_path(process, draft_version)
%>
url: legislation_process_draft_version_path(process, draft_version) %>
</aside>
</div>

View File

@@ -39,8 +39,7 @@
<h2><%= t("legislation.shared.share") %></h2>
<%= render "/shared/social_share",
title: t("legislation.shared.share_comment", version_name: @draft_version.title.downcase, process_name: @process.title),
url: legislation_process_draft_version_annotations_path(@process, @draft_version)
%>
url: legislation_process_draft_version_annotations_path(@process, @draft_version) %>
</aside>
</div>

View File

@@ -41,8 +41,7 @@
title: @process.title,
url: legislation_process_url(@process),
description: @process.title,
mobile: @process.title
%>
mobile: @process.title %>
<% if @process.image.present? %>
<hr>

View File

@@ -13,7 +13,7 @@
</div>
<div class="small-12 medium-11 column end">
<%= markdown(process.summary.present? ? process.summary : first_paragraph(process.description)) %>
<%= markdown(process.summary.presence || first_paragraph(process.description)) %>
</div>
<div class="small-12 medium-11 column end">

View File

@@ -36,8 +36,7 @@
title: proposal.title,
url: proposal_url(proposal),
description: proposal.summary,
mobile: proposal.title
%>
mobile: proposal.title %>
</div>
<% end %>
<% end %>

View File

@@ -1,7 +1,7 @@
<%= form_for(@proposal, url: form_url) do |f| %>
<%= render "shared/errors", resource: @proposal %>
<%= f.hidden_field(:legislation_process_id, :value => params[:process_id]) %>
<%= f.hidden_field(:legislation_process_id, value: params[:process_id]) %>
<div class="row">
<div class="small-12 column">

View File

@@ -70,8 +70,7 @@
title: proposal.title,
url: proposal_url(proposal),
description: proposal.summary,
mobile: proposal.title
%>
mobile: proposal.title %>
</div>
<% end %>
</div>

View File

@@ -110,8 +110,7 @@
title: @proposal.title,
url: legislation_process_proposal_url(process_id: @process),
description: @proposal.summary,
mobile: @proposal.title
%>
mobile: @proposal.title %>
</aside>
</div>
</div>

View File

@@ -25,7 +25,7 @@
<tr>
<td style="padding-bottom: 12px; text-align: center;">
<%= link_to budget_investment_url(@investment.budget, @investment, anchor: "social-share"), style: "font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; background: #f7f5f2; border-radius: 6px; color: #3d3d66!important; font-weight: bold; margin: 0px; padding: 10px 15px; text-align: center; text-decoration: none; min-width: 160px; display: inline-block;" do %>
<%= image_tag("icon_mailer_share.png", style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %>
<%= image_tag("icon_mailer_share.png", style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %>
<%= t("mailers.budget_investment_created.share") %>
<% end %>
</td>

View File

@@ -13,7 +13,7 @@
<tr>
<td style="padding-bottom: 12px; text-align: center;">
<%= link_to budget_investment_url(@investment.budget, @investment, anchor: "social-share"), style: "font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; background: #f7f5f2; border-radius: 6px; color: #3d3d66 !important; font-weight: bold; margin: 0px; padding: 10px 15px; text-align: center; text-decoration: none; min-width: 160px; display: inline-block;" do %>
<%= image_tag("icon_mailer_share.png", style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %>
<%= image_tag("icon_mailer_share.png", style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %>
<%= t("mailers.budget_investment_selected.share_button") %>
<% end %>
</td>

View File

@@ -38,12 +38,12 @@
<tr>
<td style="padding-bottom: 12px;">
<%= link_to proposal_url(notification.notifiable.proposal, anchor: "social-share"), style: "font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; background: #f7f5f2; border-radius: 6px; color: #3d3d66!important; font-weight: bold; margin: 0px; padding: 10px 15px; text-align: center; text-decoration: none; min-width: 160px; display: inline-block;" do %>
<%= image_tag("icon_mailer_share.png", style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %>
<%= image_tag("icon_mailer_share.png", style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %>
<%= t("mailers.proposal_notification_digest.share") %>
<% end %>
<%= link_to proposal_url(notification.notifiable.proposal, anchor: "comments"), style: "font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; background: #f7f5f2; border-radius: 6px; color: #3d3d66!important; font-weight: bold; margin: 0px; padding: 10px 15px; text-align: center; text-decoration: none; min-width: 160px; display: inline-block; margin-left: 12px;" do %>
<%= image_tag("icon_mailer_comment.png", style: "border: 0; display: inline-block; width: 100%; max-width: 16px; vertical-align: middle;", alt: "") %>
<%= image_tag("icon_mailer_comment.png", style: "border: 0; display: inline-block; width: 100%; max-width: 16px; vertical-align: middle;", alt: "") %>
<%= t("mailers.proposal_notification_digest.comment") %>
<% end %>
</td>

View File

@@ -1,9 +1,7 @@
<%
# Parameters:
<%# # Parameters:
# message: A string explaining the permissions
# permissions: An array of symbols containing the permissions
# (can be :debates, :proposal, :support_proposal, :votes)
%>
# (can be :debates, :proposal, :support_proposal, :votes) %>
<div class="user-permissions">
<p><%= message %></p>

View File

@@ -22,8 +22,7 @@
investment: investment,
investment_ids: @investment_ids,
investment_votes: @investment_votes,
ballot: @ballot
%>
ballot: @ballot %>
<% end %>
<%= paginate @investments %>

View File

@@ -27,8 +27,7 @@
investment: investment,
investment_ids: @investment_ids,
investment_votes: @investment_votes,
ballot: @ballot
%>
ballot: @ballot %>
<% end %>
<div class="for-print-only">

View File

@@ -4,5 +4,4 @@
<%= render "/budgets/investments/investment_show",
investment: @investment,
investment_votes: @investment_votes
%>
investment_votes: @investment_votes %>

View File

@@ -11,7 +11,7 @@
<div class="row">
<div class="small-12 column">
<%= f.select :id,
@booths.collect { |booth| [booth.location, booth.id] },
@booths.map { |booth| [booth.location, booth.id] },
selected: @booths.first,
label: false,
tabindex: "1" %>

View File

@@ -16,7 +16,7 @@
<%= f.email_field :email, placeholder: t("devise_views.organizations.registrations.new.email_label") %>
<%= f.text_field :phone_number, placeholder: t("devise_views.organizations.registrations.new.phone_number_label") %>
<%= f.text_field :phone_number, placeholder: t("devise_views.organizations.registrations.new.phone_number_label") %>
<%= f.invisible_captcha :address %>

View File

@@ -27,8 +27,7 @@
title: @poll.name,
url: poll_url(@poll),
description: @poll.name,
mobile: @poll.name
%>
mobile: @poll.name %>
</aside>
</div>
</div>

View File

@@ -36,8 +36,7 @@
title: proposal.title,
url: proposal_url(proposal),
description: proposal.summary,
mobile: proposal.title
%>
mobile: proposal.title %>
</div>
<% end %>
<% end %>

View File

@@ -25,8 +25,7 @@
title: @proposal.title,
url: proposal_url(@proposal),
description: @proposal.summary,
mobile: @proposal.title
%>
mobile: @proposal.title %>
<% if can?(:dashboard, @proposal) %>
<div class="callout light margin">

View File

@@ -1,7 +1,6 @@
<% # Params:
#
# i18n_namespace: for example "moderation.debates.index"
%>
# i18n_namespace: for example "moderation.debates.index" %>
<% if @valid_orders.present? && @valid_orders.count > 1 %>
<div class="wide-order-selector small-12 medium-8">

View File

@@ -23,7 +23,7 @@
<%= f.invisible_captcha :address %>
<%= f.email_field :email, placeholder: t("devise_views.users.registrations.new.email_label") %>
<%= f.email_field :email, placeholder: t("devise_views.users.registrations.new.email_label") %>
<%= f.password_field :password, autocomplete: "off",
placeholder: t("devise_views.users.registrations.new.password_label") %>

View File

@@ -47,7 +47,7 @@
<div class="small-12 medium-6 column end">
<%= f.number_field :price_first_year,
label: t("valuation.budget_investments.edit.price_first_year", currency: budget.currency_symbol),
label: t("valuation.budget_investments.edit.price_first_year", currency: budget.currency_symbol),
max: 1000000000000000 %>
</div>
</div>

View File

@@ -19,4 +19,18 @@ describe Budget::ContentBlock do
heading: heading_content_block_en.heading, locale: "es")
expect(valid_block).to be_valid
end
describe "#name" do
it "uses the heading name" do
block = Budget::ContentBlock.new(heading: Budget::Heading.new(name: "Central"))
expect(block.name).to eq "Central"
end
it "returns nil on new records without heading" do
block = Budget::ContentBlock.new
expect(block.name).to be_nil
end
end
end

View File

@@ -47,5 +47,6 @@ end
Capybara.exact = true
Capybara.enable_aria_label = true
Capybara.disable_animation = true
OmniAuth.config.test_mode = true