From 070ef782e6230fc7fddce10051353b32b616e8e2 Mon Sep 17 00:00:00 2001 From: Finn Woelm Date: Tue, 18 Jul 2017 13:53:14 +0700 Subject: [PATCH] Fix: Failing 'Signs Up'-Feature Tests Up to now, scripts were loaded prior to the stylesheet in . When scripts are loaded before stylesheets, it is possible that scripts execute on the DOM elements before styles are fully loaded. This can yield unexpected results. In the case of the features/desktop/signs_up.feature tests, it would happen every so often that the scripts ran before styles were loaded. For example, the app.views.Publisher class (responsible for actions related to creating a new post) relies on the poll element being either hidden (or poll options being defined). As per stylesheet, the poll is hidden by default. But when the scripts run before the stylesheet has loaded, the poll appears visible to the script and post submission is disabled. This is fixed by loading stylesheets prior to scripts. See SO for more info: https://stackoverflow.com/a/1324720/6451879 --- app/views/layouts/application.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 6e26cd408..a8e8a6e85 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -17,8 +17,8 @@ = javascript_include_tag :main, :templates = load_javascript_locales - = render "head" = include_color_theme + = render "head" = translation_missing_warnings %body{class: "page-#{controller_name} action-#{action_name}"}