Add remote translations to welcome

This commit is contained in:
taitus
2019-01-25 17:42:29 +01:00
committed by voodoorai2000
parent b3ae9038c3
commit aad6491049
2 changed files with 21 additions and 1 deletions

View File

@@ -1,4 +1,6 @@
class WelcomeController < ApplicationController
include RemotelyTranslatable
skip_authorization_check
before_action :set_user_recommendations, only: :index, if: :current_user
before_action :authenticate_user!, only: :welcome
@@ -9,7 +11,10 @@ class WelcomeController < ApplicationController
@header = Widget::Card.header.first
@feeds = Widget::Feed.active
@cards = Widget::Card.body
@banners = Banner.in_section("homepage").with_active
@banners = Banner.in_section('homepage').with_active
@remote_translations = detect_remote_translations(@feeds,
@recommended_debates,
@recommended_proposals)
end
def welcome

View File

@@ -4,6 +4,21 @@ describe "Welcome screen" do
let(:budget) { create(:budget) }
it_behaves_like "remotely_translatable",
:proposal,
"root_path",
{}
it_behaves_like "remotely_translatable",
:debate,
"root_path",
{}
it_behaves_like "remotely_translatable",
:legislation_process,
"root_path",
{}
scenario "requires a logged in user" do
visit welcome_path
expect(page).to have_content "You must sign in or register to continue."