Merge branch 'main' into glitch-soc/merge-upstream
- `.env.production.sample`: Our sample config file is very different from upstream since it is much more complete. Upstream added documentation for a few env variables. Copied the new variables/documentation from upstream. - `app/lib/feed_manager.rb`: Upstream added a timeline type (hashtags), while glitch-soc already had an extra one (direct messages). Not really a conflict but textually close changes. Ported upstream's changes. - `app/models/custom_emoji.rb`: Upstream upped the custom emoji size limit, while glitch-soc had configurable limits. Upped the default limits accordingly. - `streaming/index.js`: Upstream reworked how hastags were normalized. Minor conflict due to glitch-soc's handling of instance-local posts. Ported upstream's changes.
This commit is contained in:
4
spec/models/tag_follow_spec.rb
Normal file
4
spec/models/tag_follow_spec.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe TagFollow, type: :model do
|
||||
end
|
||||
@@ -91,7 +91,7 @@ RSpec.describe Tag, type: :model do
|
||||
upcase_string = 'abcABCabcABCやゆよ'
|
||||
downcase_string = 'abcabcabcabcやゆよ';
|
||||
|
||||
tag = Fabricate(:tag, name: downcase_string)
|
||||
tag = Fabricate(:tag, name: HashtagNormalizer.new.normalize(downcase_string))
|
||||
expect(Tag.find_normalized(upcase_string)).to eq tag
|
||||
end
|
||||
end
|
||||
@@ -101,12 +101,12 @@ RSpec.describe Tag, type: :model do
|
||||
upcase_string = 'abcABCabcABCやゆよ'
|
||||
downcase_string = 'abcabcabcabcやゆよ';
|
||||
|
||||
tag = Fabricate(:tag, name: downcase_string)
|
||||
tag = Fabricate(:tag, name: HashtagNormalizer.new.normalize(downcase_string))
|
||||
expect(Tag.matches_name(upcase_string)).to eq [tag]
|
||||
end
|
||||
|
||||
it 'uses the LIKE operator' do
|
||||
expect(Tag.matches_name('100%abc').to_sql).to eq %q[SELECT "tags".* FROM "tags" WHERE LOWER("tags"."name") LIKE LOWER('100\\%abc%')]
|
||||
expect(Tag.matches_name('100%abc').to_sql).to eq %q[SELECT "tags".* FROM "tags" WHERE LOWER("tags"."name") LIKE LOWER('100abc%')]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -115,7 +115,7 @@ RSpec.describe Tag, type: :model do
|
||||
upcase_string = 'abcABCabcABCやゆよ'
|
||||
downcase_string = 'abcabcabcabcやゆよ';
|
||||
|
||||
tag = Fabricate(:tag, name: downcase_string)
|
||||
tag = Fabricate(:tag, name: HashtagNormalizer.new.normalize(downcase_string))
|
||||
expect(Tag.matching_name(upcase_string)).to eq [tag]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user