Fix houncibot offenses: Style/StringLiterals

This commit is contained in:
taitus
2019-05-30 17:03:46 +02:00
committed by voodoorai2000
parent aad6491049
commit 3a154a57cb
3 changed files with 18 additions and 18 deletions

View File

@@ -11,7 +11,7 @@ class WelcomeController < ApplicationController
@header = Widget::Card.header.first @header = Widget::Card.header.first
@feeds = Widget::Feed.active @feeds = Widget::Feed.active
@cards = Widget::Card.body @cards = Widget::Card.body
@banners = Banner.in_section('homepage').with_active @banners = Banner.in_section("homepage").with_active
@remote_translations = detect_remote_translations(@feeds, @remote_translations = detect_remote_translations(@feeds,
@recommended_debates, @recommended_debates,
@recommended_proposals) @recommended_proposals)

View File

@@ -49,7 +49,7 @@ module RemoteTranslations::Microsoft::AvailableLocales
end end
def daily_cache(key, &block) def daily_cache(key, &block)
Rails.cache.fetch("remote_available_locales/#{Time.current.strftime('%Y-%m-%d')}/#{key}", &block) Rails.cache.fetch("remote_available_locales/#{Time.current.strftime("%Y-%m-%d")}/#{key}", &block)
end end
end end

View File

@@ -27,7 +27,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
scenario "should be present when current locale translation does not exists", :js do scenario "should be present when current locale translation does not exists", :js do
visit path visit path
select('Deutsch', from: 'locale-switcher') select("Deutsch", from: "locale-switcher")
expect(page).to have_button("Translate page") expect(page).to have_button("Translate page")
end end
@@ -37,7 +37,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
visit path visit path
expect(page).not_to have_button("Translate page") expect(page).not_to have_button("Translate page")
select('Deutsch', from: 'locale-switcher') select("Deutsch", from: "locale-switcher")
expect(page).not_to have_button("Translate page") expect(page).not_to have_button("Translate page")
end end
@@ -47,7 +47,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
resource.destroy resource.destroy
visit path visit path
select('Deutsch', from: 'locale-switcher') select("Deutsch", from: "locale-switcher")
expect(page).not_to have_button("Translate page") expect(page).not_to have_button("Translate page")
end end
@@ -81,7 +81,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
visit path visit path
expect(page).not_to have_button("Translate page") expect(page).not_to have_button("Translate page")
select('Deutsch', from: 'locale-switcher') select("Deutsch", from: "locale-switcher")
expect(page).not_to have_button("Translate page") expect(page).not_to have_button("Translate page")
end end
@@ -102,7 +102,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
visit path visit path
expect(page).not_to have_button("Translate page") expect(page).not_to have_button("Translate page")
select('Deutsch', from: 'locale-switcher') select("Deutsch", from: "locale-switcher")
expect(page).to have_button("Translate page") expect(page).to have_button("Translate page")
end end
@@ -113,7 +113,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
visit path visit path
expect(page).not_to have_button("Translate page") expect(page).not_to have_button("Translate page")
select('Deutsch', from: 'locale-switcher') select("Deutsch", from: "locale-switcher")
expect(page).not_to have_button("Translate page") expect(page).not_to have_button("Translate page")
end end
@@ -130,7 +130,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
visit path visit path
expect(page).not_to have_button("Translate page") expect(page).not_to have_button("Translate page")
select('Deutsch', from: 'locale-switcher') select("Deutsch", from: "locale-switcher")
expect(page).to have_button("Translate page") expect(page).to have_button("Translate page")
end end
@@ -147,7 +147,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
visit path visit path
expect(page).not_to have_button("Translate page") expect(page).not_to have_button("Translate page")
select('Deutsch', from: 'locale-switcher') select("Deutsch", from: "locale-switcher")
expect(page).to have_button("Translate page") expect(page).to have_button("Translate page")
end end
@@ -170,7 +170,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
scenario "the remote translation button should not be present", :js do scenario "the remote translation button should not be present", :js do
visit path visit path
select('Deutsch', from: 'locale-switcher') select("Deutsch", from: "locale-switcher")
click_button "Translate page" click_button "Translate page"
@@ -179,14 +179,14 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
scenario "the remote translation is pending to translate", :js do scenario "the remote translation is pending to translate", :js do
visit path visit path
select('Deutsch', from: 'locale-switcher') select("Deutsch", from: "locale-switcher")
expect { click_button "Translate page" }.to change { RemoteTranslation.count }.from(0).to(1) expect { click_button "Translate page" }.to change { RemoteTranslation.count }.from(0).to(1)
end end
scenario "should be present enqueued notice and informative text", :js do scenario "should be present enqueued notice and informative text", :js do
visit path visit path
select('Deutsch', from: 'locale-switcher') select("Deutsch", from: "locale-switcher")
click_button "Translate page" click_button "Translate page"
@@ -196,14 +196,14 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
scenario "should be present only informative text when user visit page with all content enqueued", :js do scenario "should be present only informative text when user visit page with all content enqueued", :js do
visit path visit path
select('Deutsch', from: 'locale-switcher') select("Deutsch", from: "locale-switcher")
click_button "Translate page" click_button "Translate page"
expect(page).to have_content("Translations have been correctly requested.") expect(page).to have_content("Translations have been correctly requested.")
visit path visit path
select('Deutsch', from: 'locale-switcher') select("Deutsch", from: "locale-switcher")
expect(page).not_to have_button 'Translate text' expect(page).not_to have_button "Translate text"
expect(page).not_to have_content("Translations have been correctly requested.") expect(page).not_to have_content("Translations have been correctly requested.")
expect(page).to have_content("In a short period of time refreshing the page you will be able to see all the content in your language.") expect(page).to have_content("In a short period of time refreshing the page you will be able to see all the content in your language.")
end end
@@ -216,7 +216,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
microsoft_translate_client_response = generate_response(resource) microsoft_translate_client_response = generate_response(resource)
expect_any_instance_of(RemoteTranslations::Microsoft::Client).to receive(:call).and_return(microsoft_translate_client_response) expect_any_instance_of(RemoteTranslations::Microsoft::Client).to receive(:call).and_return(microsoft_translate_client_response)
visit path visit path
select('Deutsch', from: 'locale-switcher') select("Deutsch", from: "locale-switcher")
click_button "Translate page" click_button "Translate page"
@@ -227,7 +227,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
microsoft_translate_client_response = generate_response(resource) microsoft_translate_client_response = generate_response(resource)
expect_any_instance_of(RemoteTranslations::Microsoft::Client).to receive(:call).and_return(microsoft_translate_client_response) expect_any_instance_of(RemoteTranslations::Microsoft::Client).to receive(:call).and_return(microsoft_translate_client_response)
visit path visit path
select('Deutsch', from: 'locale-switcher') select("Deutsch", from: "locale-switcher")
click_button "Translate page" click_button "Translate page"