mirror of
https://github.com/redmine/redmine.git
synced 2025-11-15 09:46:02 +01:00
Add test for 4 byte characters (emoji) support (#32054).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@20780 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -183,6 +183,10 @@ class ActiveSupport::TestCase
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def is_mysql_utf8mb4
|
||||||
|
self.class.is_mysql_utf8mb4
|
||||||
|
end
|
||||||
|
|
||||||
def repository_path_hash(arr)
|
def repository_path_hash(arr)
|
||||||
hs = {}
|
hs = {}
|
||||||
hs[:path] = arr.join("/")
|
hs[:path] = arr.join("/")
|
||||||
|
|||||||
@@ -218,6 +218,17 @@ class IssueTest < ActiveSupport::TestCase
|
|||||||
assert_equal issues.collect(&:id).sort, Issue.all.select {|issue| issue.visible?(user)}.collect(&:id).sort
|
assert_equal issues.collect(&:id).sort, Issue.all.select {|issue| issue.visible?(user)}.collect(&:id).sort
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_create_with_emoji_character
|
||||||
|
skip if Redmine::Database.mysql? && !is_mysql_utf8mb4
|
||||||
|
|
||||||
|
set_language_if_valid 'en'
|
||||||
|
issue = Issue.new(:project_id => 1, :tracker_id => 1,
|
||||||
|
:author_id => 1, :subject => 'Group assignment',
|
||||||
|
:description => 'Hello 😀')
|
||||||
|
assert issue.save
|
||||||
|
assert_equal 'Hello 😀', issue.description
|
||||||
|
end
|
||||||
|
|
||||||
def test_visible_scope_for_anonymous
|
def test_visible_scope_for_anonymous
|
||||||
# Anonymous user should see issues of public projects only
|
# Anonymous user should see issues of public projects only
|
||||||
issues = Issue.visible(User.anonymous).to_a
|
issues = Issue.visible(User.anonymous).to_a
|
||||||
|
|||||||
Reference in New Issue
Block a user