diff options
author | ThibG <thib@sitedethib.com> | 2019-07-29 23:37:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-29 23:37:14 +0200 |
commit | f48c7689d230b915ed740a4774736bd5998cbc66 (patch) | |
tree | 3d883f06fe8e3abbc5653e029ac8612ae114f135 /spec/lib | |
parent | a4a81c5434c73139f7c1d66f2687039237c5208a (diff) | |
parent | 51411267fda00db576230a270a10e31992378c18 (diff) |
Merge pull request #1179 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/spam_check_spec.rb | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/spec/lib/spam_check_spec.rb b/spec/lib/spam_check_spec.rb index c722dc642..9e0989216 100644 --- a/spec/lib/spam_check_spec.rb +++ b/spec/lib/spam_check_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rails_helper' RSpec.describe SpamCheck do @@ -133,7 +135,31 @@ RSpec.describe SpamCheck do end describe '#remember!' do - pending + let(:status) { status_with_html('@alice') } + let(:spam_check) { described_class.new(status) } + let(:redis_key) { spam_check.send(:redis_key) } + + it 'remembers' do + expect do + spam_check.remember! + end.to change { Redis.current.exists(redis_key) }.from(false).to(true) + end + end + + describe '#reset!' do + let(:status) { status_with_html('@alice') } + let(:spam_check) { described_class.new(status) } + let(:redis_key) { spam_check.send(:redis_key) } + + before do + spam_check.remember! + end + + it 'resets' do + expect do + spam_check.reset! + end.to change { Redis.current.exists(redis_key) }.from(true).to(false) + end end describe '#flag!' do |