Add remote translations to welcome
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user