Skip to content

Commit

Permalink
Fix rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
andreslucena committed Dec 20, 2023
1 parent cd65cad commit a81761d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/i18n_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module I18nHelpers
# @param loc [Symbol] The current locale
# @param current_path [String] The current page. We give it as a parameter to it's easier to test.
def current_path_for_locale(loc = I18n.locale, current_path = current_page.url)
url_regex = %r{\A/(?:(#{I18n.available_locales.join('|')})/)?}
url_regex = %r{\A/(?:(#{I18n.available_locales.join("|")})/)?}
if current_path.gsub(url_regex, "").blank?
home_for_locale(loc)
else
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

require "middleman-blog"

middleman_app = ::Middleman::Application.new do
middleman_app = Middleman::Application.new do
set :root, File.expand_path(File.join(File.dirname(__FILE__), ".."))
set :environment, :test
set :show_exceptions, false
end

Capybara.app = ::Middleman::Rack.new(middleman_app).to_app
Capybara.app = Middleman::Rack.new(middleman_app).to_app

RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate
Expand Down
4 changes: 2 additions & 2 deletions spec/system/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
end

it "has the correct title header" do
expect(page).to have_selector "h1"
expect(page).to have_css "h1"
within "h1" do
expect(page).to have_content(/Decidim is a digital platform for citizen participation/i)
end
end

it "has a navigation with the languages" do
expect(page).to have_selector "nav details"
expect(page).to have_css "nav details"

within "nav details" do
expect(page).to have_text "Castellano"
Expand Down
4 changes: 2 additions & 2 deletions spec/system/language_selector_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
end

it "has the correct title header" do
expect(page).to have_selector "h1"
expect(page).to have_css "h1"
within "h1" do
expect(page).to have_content "Decidim és una plataforma digital de participació ciutadana"
end
end

it "changes the locale" do
expect(page).to have_selector "nav details"
expect(page).to have_css "nav details"

within "nav details" do
expect(page).to have_text "Castellano"
Expand Down
4 changes: 2 additions & 2 deletions spec/system/pages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
end

it "has the correct title header" do
expect(page).to have_selector "h1"
expect(page).to have_css "h1"
within "h1" do
expect(page).to have_content(/Trademark policy/i)
end
end

it "has the correct links" do
expect(page).to have_selector "main"
expect(page).to have_css "main"

within "main" do
expect(page).to have_link "Ruby on Rails", href: "https://rubyonrails.org/trademarks"
Expand Down

0 comments on commit a81761d

Please sign in to comment.