From a390abdefb5d741ba4375858a79fbf3eaf30f06d Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 21 Jul 2017 04:27:40 +0200 Subject: Use the same emoji data on the frontend and backend (#4284) * Use the same emoji data on the frontend and backend * Move emoji.json to repository, add tests This way you don't need to install node dependencies if you only want to run Ruby code --- spec/lib/emoji_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 spec/lib/emoji_spec.rb (limited to 'spec') diff --git a/spec/lib/emoji_spec.rb b/spec/lib/emoji_spec.rb new file mode 100644 index 000000000..04931ccfb --- /dev/null +++ b/spec/lib/emoji_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +RSpec.describe Emoji do + describe '#unicode' do + it 'returns a unicode for a shortcode' do + expect(Emoji.instance.unicode(':joy:')).to eq '😂' + end + end + + describe '#names' do + it 'returns an array' do + expect(Emoji.instance.names).to be_an Array + end + end +end -- cgit From dbaa6a0e13b66ebd7cb0a622db55471f63da3d2f Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 21 Jul 2017 12:45:13 +0200 Subject: Fix intermittent test failures due to accidentally reused class instance between threads (#4287) --- spec/services/resolve_remote_account_service_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/services/resolve_remote_account_service_spec.rb b/spec/services/resolve_remote_account_service_spec.rb index ab5d3c6e5..c3b902b34 100644 --- a/spec/services/resolve_remote_account_service_spec.rb +++ b/spec/services/resolve_remote_account_service_spec.rb @@ -78,7 +78,7 @@ RSpec.describe ResolveRemoteAccountService do Thread.new do true while wait_for_start begin - return_values << subject.call('foo@localdomain.com') + return_values << ResolveRemoteAccountService.new.call('foo@localdomain.com') rescue ActiveRecord::RecordNotUnique fail_occurred = true end -- cgit