From ccb9c1b952e87dd954bfb651db59dc02a4d9341f Mon Sep 17 00:00:00 2001 From: ysksn Date: Fri, 28 Dec 2018 16:18:47 +0900 Subject: Add pending specs for StatusLengthValidator (#9647) * Add pending specs of StatusLengthValidator * Use instance variable --- spec/validators/status_length_validator_spec.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'spec') diff --git a/spec/validators/status_length_validator_spec.rb b/spec/validators/status_length_validator_spec.rb index e2d1a15ec..11e55f933 100644 --- a/spec/validators/status_length_validator_spec.rb +++ b/spec/validators/status_length_validator_spec.rb @@ -4,8 +4,17 @@ require 'rails_helper' describe StatusLengthValidator do describe '#validate' do - it 'does not add errors onto remote statuses' - it 'does not add errors onto local reblogs' + it 'does not add errors onto remote statuses' do + status = double(local?: false) + subject.validate(status) + expect(status).not_to receive(:errors) + end + + it 'does not add errors onto local reblogs' do + status = double(local?: false, reblog?: true) + subject.validate(status) + expect(status).not_to receive(:errors) + end it 'adds an error when content warning is over 500 characters' do status = double(spoiler_text: 'a' * 520, text: '', errors: double(add: nil), local?: true, reblog?: false) -- cgit