diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-03-02 12:06:58 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2021-03-02 12:06:58 +0100 |
commit | d8fdbb054e30f6e8e505bce63e5f150bf117cd8e (patch) | |
tree | 0a671ee6c8a7644e6613dd87798f661f4703e8fe /spec/validators/status_length_validator_spec.rb | |
parent | 4aa860b65bd796b09dc0ceffa1fdd7de31060a34 (diff) | |
parent | 65db2625508c220fd3c0a1f37cdd2e13b6e02987 (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `app/validators/status_length_validator.rb`: Upstream changes too close to glitch-soc MAX_CHARS changes, but not a real conflict. Applied upstream changes. - `package.json`: glitch-soc-only dependency textually too close to a dependency updated upstream, not a real conflict. Applied upstream changes.
Diffstat (limited to 'spec/validators/status_length_validator_spec.rb')
-rw-r--r-- | spec/validators/status_length_validator_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/validators/status_length_validator_spec.rb b/spec/validators/status_length_validator_spec.rb index 62791cd2f..643ea6d22 100644 --- a/spec/validators/status_length_validator_spec.rb +++ b/spec/validators/status_length_validator_spec.rb @@ -47,6 +47,14 @@ describe StatusLengthValidator do expect(status.errors).to_not have_received(:add) end + it 'does not count non-autolinkable URLs as 23 characters flat' do + text = ('a' * 476) + "http://#{'b' * 30}.com/example" + status = double(spoiler_text: '', text: text, errors: double(add: nil), local?: true, reblog?: false) + + subject.validate(status) + expect(status.errors).to have_received(:add) + end + it 'counts only the front part of remote usernames' do username = '@alice' chars = StatusLengthValidator::MAX_CHARS - 1 - username.length |