Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="collapse navbar-collapse" id="header-navbar-collapse">
<form class="form-inline mr-3" id="searchform" autocomplete="off">
<div class="input-group">
<input aria-label="Enter Search Query" type="text" id="searchform_input" class="form-control search-query typeahead" role="search" qryType="tags" placeholder="<%= translation('layout._header.search',{},false) %>" value="<%= params[:query] %>" required>
<input aria-label="Enter Search Query" type="text" id="searchform_input" class="form-control search-query typeahead" role="search" qryType="tags" placeholder="<%= translation('layout._header.search', {}, false) %>" value="<%= params[:query] %>" required>
<div class="input-group-append">
<button class="btn btn-light" type="submit" title="Search button" aria-label="Search Button"><i class="fa fa-search"></i></button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion test/integration/I18n_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'sanitize'

class I18nTest < ActionDispatch::IntegrationTest

test 'should choose i18n-locale for header partial' do
available_testing_locales.each do |lang|
# This test could use a rewrite. Two `get`s in succession?
Expand Down
17 changes: 17 additions & 0 deletions test/system/dashboard_test.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
require "application_system_test_case"
require "i18n"

class DashboardTest < ApplicationSystemTestCase
Capybara.default_max_wait_time = 60

test 'should translate search input bar' do
available_testing_locales.each do |lang|
visit '/'
visit '/change_locale/'+lang.to_s
click_on I18n.t('layout._header.login.login_title', locale: lang)
fill_in("username-login", with: "Bob")
fill_in("password-signup", with: "secretive")
click_on I18n.t('user_sessions.new.log_in', locale: lang)
visit '/dashboard'
uid = users(:bob).id
visit '/profile/tags/create/'+uid.to_s+'?translationswitch=yes&name=translation-helper'
assert_selector(:xpath, './/input[@id="searchform_input"][contains(@placeholder,"Search")]')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!!!

visit '/logout'
end
end

test 'viewing the dashboard' do
visit '/'

Expand Down