From c03be4c060aa30f046ec6faed29aa29995c1ac0c Mon Sep 17 00:00:00 2001 From: Marius BALTEANU Date: Sat, 17 Aug 2019 15:11:55 +0300 Subject: [PATCH 1/2] Update default database config for MySQL --- config/database.yml.example | 11 +++++++---- test/unit/issue_test.rb | 10 ++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/config/database.yml.example b/config/database.yml.example index 57bc51605..f1df53cb5 100644 --- a/config/database.yml.example +++ b/config/database.yml.example @@ -1,4 +1,4 @@ -# Default setup is given for MySQL with ruby1.9. +# Default setup is given for MySQL 5.7 with ruby2.2. # Examples for PostgreSQL, SQLite3 and SQL Server can be found at the end. # Line indentation must be 2 spaces (no tabs). @@ -8,7 +8,8 @@ production: host: localhost username: root password: "" - encoding: utf8 + # Remove encoding for existing installation on MySQL + encoding: utf8mb4 development: adapter: mysql2 @@ -16,7 +17,8 @@ development: host: localhost username: root password: "" - encoding: utf8 + # Remove encoding for existing installation on MySQL + encoding: utf8mb4 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". @@ -27,7 +29,8 @@ test: host: localhost username: root password: "" - encoding: utf8 + # Remove encoding for existing installation on MySQL + encoding: utf8mb4 # PostgreSQL configuration example #production: diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index c05e1152f..d74c64741 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -218,6 +218,16 @@ class IssueTest < ActiveSupport::TestCase assert_equal issues.collect(&:id).sort, Issue.all.select {|issue| issue.visible?(user)}.collect(&:id).sort end + def test_create_with_emoji_character + 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 # Anonymous user should see issues of public projects only issues = Issue.visible(User.anonymous).to_a -- 2.22.0