Project

General

Profile

Patch #32054 » test_for_emoji_support-v2.patch

Go MAEDA, 2021-03-12 10:03

View differences:

test/test_helper.rb
183 183
    return true
184 184
  end
185 185

  
186
  def is_mysql_utf8mb4
187
    self.class.is_mysql_utf8mb4
188
  end
189

  
186 190
  def repository_path_hash(arr)
187 191
    hs = {}
188 192
    hs[:path]  = arr.join("/")
test/unit/issue_test.rb
218 218
    assert_equal issues.collect(&:id).sort, Issue.all.select {|issue| issue.visible?(user)}.collect(&:id).sort
219 219
  end
220 220

  
221
  def test_create_with_emoji_character
222
    skip if Redmine::Database.mysql? && !is_mysql_utf8mb4
223

  
224
    set_language_if_valid 'en'
225
    issue = Issue.new(:project_id => 1, :tracker_id => 1,
226
                      :author_id => 1, :subject => 'Group assignment',
227
                      :description => 'Hello 😀')
228
    assert issue.save
229
    assert_equal 'Hello 😀', issue.description
230
  end
231

  
221 232
  def test_visible_scope_for_anonymous
222 233
    # Anonymous user should see issues of public projects only
223 234
    issues = Issue.visible(User.anonymous).to_a
(2-2/2)