Fix tests for Redmine 4
This commit is contained in:
@@ -12,6 +12,13 @@ env:
|
||||
sudo: true
|
||||
cache: bundler
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
urls:
|
||||
secure: "lwJzu9BU7AVhHnROzEA6agagwsqVAaTzgtvwTlw4CwSUv0ypNXNi9kjJUvOgSit3BnkSccC9xYlYNOYw5OOmsmjyUDU4/LUVqd0DRQjW3FXU9EFFPGQq9srJikHOHobfnutxGwMYFE4ftLI08PzsL7bYEg39Ps3pwwWsiIKnKKI0DPmdQH5PzC63jF/EByrLZsfqGHOirgXDnxmwgmrQ14vOpp3lHjgNgx9wNALpSgAztKeK1Wd8KayLYXweu+LQx9IwJfLqvk6hhWW15vjkIhvK7ooYSGXx+Hlwg3jyFSyX5jButUT4vwlWdJeAoNO/sWpdKXv4AifGXYsbcF/LMHCaaVgwBm/pe/YlK2LrqFlpm7MFuqyO1w4AnIA7rC8wZp/dUU5bJITZgN3sTAbLyTIbF8cbMfbDy3IWP8Oub7K/0ATUD7vNBVuyxfdGG61xOv/RDQhzrGwUArJ/xJfdU77MZkQUnaGb0vcwmRLIxyPdZWPz9ntzCbBxFblPWApCw+CWOeM3OuR6tdVqSVuZx3aG87TTzW+S9lLe8PJ5HYgA6+rPkc04zolJMftnFVlUl3LQIKvV2QkPSnr9bcePR5YSoJJKLBVofUsg/btVkQ1OxhWn53Td/nQp7u8qosmyQjCjMiP6Po1e9Enr89FY8Yxkw2dQba5sumQRbB39bj0="
|
||||
on_success: change
|
||||
on_failure: always
|
||||
|
||||
addons:
|
||||
postgresql: "9.6"
|
||||
|
||||
|
||||
@@ -18,10 +18,6 @@ class CommonViewsTest < Redmine::IntegrationTest
|
||||
|
||||
def setup
|
||||
RedmineMessenger::TestCase.prepare
|
||||
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
@request.env['HTTP_REFERER'] = '/'
|
||||
end
|
||||
|
||||
test 'View user' do
|
||||
|
||||
@@ -36,10 +36,6 @@ module RedmineMessenger
|
||||
ActionController::TestUploadedFile.new(ActiveSupport::TestCase.fixture_path + "/files/#{name}", mime, true)
|
||||
end
|
||||
|
||||
def self.arrays_equal?(a1, a2)
|
||||
(a1 - a2) - (a2 - a1) == []
|
||||
end
|
||||
|
||||
def self.create_fixtures(fixtures_directory, table_names, _class_names = {})
|
||||
ActiveRecord::FixtureSet.create_fixtures(fixtures_directory, table_names, _class_names = {})
|
||||
end
|
||||
|
||||
@@ -1,40 +1,38 @@
|
||||
require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
module Redmine
|
||||
class I18nTest < ActiveSupport::TestCase
|
||||
include Redmine::I18n
|
||||
class I18nTest < ActiveSupport::TestCase
|
||||
include Redmine::I18n
|
||||
|
||||
def setup
|
||||
User.current = nil
|
||||
end
|
||||
def setup
|
||||
User.current = nil
|
||||
end
|
||||
|
||||
def teardown
|
||||
set_language_if_valid 'en'
|
||||
end
|
||||
def teardown
|
||||
set_language_if_valid 'en'
|
||||
end
|
||||
|
||||
def test_valid_languages
|
||||
assert valid_languages.is_a?(Array)
|
||||
assert valid_languages.first.is_a?(Symbol)
|
||||
end
|
||||
def test_valid_languages
|
||||
assert valid_languages.is_a?(Array)
|
||||
assert valid_languages.first.is_a?(Symbol)
|
||||
end
|
||||
|
||||
def test_locales_validness
|
||||
lang_files_count = Dir[Rails.root.join('plugins',
|
||||
'redmine_messenger',
|
||||
'config',
|
||||
'locales',
|
||||
'*.yml')].size
|
||||
assert_equal lang_files_count, 3
|
||||
valid_languages.each do |lang|
|
||||
assert set_language_if_valid(lang)
|
||||
end
|
||||
# check if parse error exists
|
||||
::I18n.locale = 'de'
|
||||
assert_equal 'Messenger Benutzer', l(:label_settings_messenger_username)
|
||||
::I18n.locale = 'en'
|
||||
assert_equal 'Messenger username', l(:label_settings_messenger_username)
|
||||
::I18n.locale = 'ja'
|
||||
assert_equal 'メッセンジャーのユーザー名', l(:label_settings_messenger_username)
|
||||
set_language_if_valid('en')
|
||||
def test_locales_validness
|
||||
lang_files_count = Dir[Rails.root.join('plugins',
|
||||
'redmine_messenger',
|
||||
'config',
|
||||
'locales',
|
||||
'*.yml')].size
|
||||
assert_equal lang_files_count, 3
|
||||
valid_languages.each do |lang|
|
||||
assert set_language_if_valid(lang)
|
||||
end
|
||||
# check if parse error exists
|
||||
::I18n.locale = 'de'
|
||||
assert_equal 'Messenger Benutzer', l(:label_settings_messenger_username)
|
||||
::I18n.locale = 'en'
|
||||
assert_equal 'Messenger username', l(:label_settings_messenger_username)
|
||||
::I18n.locale = 'ja'
|
||||
assert_equal 'メッセンジャーのユーザー名', l(:label_settings_messenger_username)
|
||||
set_language_if_valid('en')
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user