trabajo-afectivo/spec/system/user/history_spec.rb
Zammad Weblate e83f9b88ca Maintenance: Translations update from translations.zammad.org.
Special thanks to the amazing translation team. You rock! 💪

Co-authored-by: Jean-Etienne Castagnede <jecastagnede@vivaldi.net>
Co-authored-by: Marcel Herrguth <github@thehomeofanime.de>
Co-authored-by: Martin Gruner <mg@zammad.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: crnfpp <crnfpp@unife.it>
Translate-URL: https://translations.zammad.org/projects/zammad/zammad-development/
Translate-URL: https://translations.zammad.org/projects/zammad/zammad-development/de/
Translate-URL: https://translations.zammad.org/projects/zammad/zammad-development/fr/
Translate-URL: https://translations.zammad.org/projects/zammad/zammad-development/it/
Translation: Zammad/Zammad (development version)
2022-03-05 10:01:16 +01:00

60 lines
1.9 KiB
Ruby

# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
require 'rails_helper'
RSpec.describe 'Ticket history', type: :system, time_zone: 'Europe/London' do
let(:group) { Group.find_by(name: 'Users') }
let(:customer) { create(:customer) }
let!(:session_user) { User.find_by(login: 'admin@example.com') }
before do
freeze_time
travel_to DateTime.parse('2021-01-22 13:40:00 UTC')
current_time = Time.current
customer.update! firstname: 'Customer'
customer.update! email: 'test@example.com'
customer.update! country: 'Germany'
customer.update! out_of_office_start_at: current_time
customer.update! last_login: current_time
travel_to DateTime.parse('2021-04-06 23:30:00 UTC')
current_time = Time.current
customer.update! lastname: 'Example'
customer.update! mobile: '5757473827'
customer.update! out_of_office_end_at: current_time
customer.update! last_login: current_time
travel_back
session_user.preferences[:locale] = 'de-de'
session_user.save!
# Suppress the modal dialog that invites to contributions for translations that are < 90% as this breaks the tests for de-de.
page.evaluate_script "App.LocalStorage.set('translation_support_no', true, App.Session.get('id'))"
refresh
visit "#user/profile/#{customer.id}"
find('#userAction').click
click('[data-type="history"]')
end
it "translates timestamp when attribute's tag is datetime" do
expect(page).to have_css('li', text: %r{'22.01.2021 00:00'})
end
it 'does not include time with UTC format' do
# sleep 5
expect(page).to have_no_text(%r{ UTC})
end
it 'translates out_of_office_start_at value to time stamp' do
expect(page).to have_css('li', text: %r{Benutzer out_of_office_start_at '22.01.2021 00:00'})
end
it 'translates out_of_office_end_at value to time stamp' do
expect(page).to have_css('li', text: %r{Benutzer out_of_office_end_at '06.04.2021 01:00'})
end
end