.github
app
bin
config
db
docs
lib
log
nanobox
public
spec
controllers
fabricators
features
fixtures
helpers
lib
mailers
models
admin
concerns
form
web
account_domain_block_spec.rb
account_filter_spec.rb
account_moderation_note_spec.rb
account_spec.rb
backup_spec.rb
block_spec.rb
conversation_mute_spec.rb
conversation_spec.rb
custom_emoji_spec.rb
domain_block_spec.rb
email_domain_block_spec.rb
export_spec.rb
favourite_spec.rb
follow_request_spec.rb
follow_spec.rb
home_feed_spec.rb
identity_spec.rb
import_spec.rb
invite_spec.rb
list_account_spec.rb
list_spec.rb
media_attachment_spec.rb
mention_spec.rb
mute_spec.rb
notification_spec.rb
preview_card_spec.rb
remote_follow_spec.rb
remote_profile_spec.rb
report_filter_spec.rb
report_spec.rb
session_activation_spec.rb
setting_spec.rb
site_upload_spec.rb
status_pin_spec.rb
status_spec.rb
stream_entry_spec.rb
subscription_spec.rb
tag_spec.rb
user_spec.rb
policies
presenters
requests
routing
services
support
validators
views
workers
rails_helper.rb
spec_helper.rb
streaming
vendor
.babelrc
.buildpacks
.codeclimate.yml
.dockerignore
.editorconfig
.env.nanobox
.env.production.sample
.env.test
.env.vagrant
.eslintignore
.eslintrc.yml
.foreman
.gitattributes
.gitignore
.haml-lint.yml
.nanoignore
.nvmrc
.postcssrc.yml
.profile
.rspec
.rubocop.yml
.ruby-version
.scss-lint.yml
.slugignore
.travis.yml
.yarnclean
AUTHORS.md
Aptfile
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Capfile
Dockerfile
Gemfile
Gemfile.lock
LICENSE
Procfile
Procfile.dev
README.md
Rakefile
Vagrantfile
app.json
boxfile.yml
config.ru
docker-compose.yml
jest.config.js
package.json
scalingo.json
yarn.lock
23 lines
756 B
Ruby
23 lines
756 B
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe AccountDomainBlock, type: :model do
|
|
it 'removes blocking cache after creation' do
|
|
account = Fabricate(:account)
|
|
Rails.cache.write("exclude_domains_for:#{account.id}", 'a.domain.already.blocked')
|
|
|
|
AccountDomainBlock.create!(account: account, domain: 'a.domain.blocked.later')
|
|
|
|
expect(Rails.cache.exist?("exclude_domains_for:#{account.id}")).to eq false
|
|
end
|
|
|
|
it 'removes blocking cache after destruction' do
|
|
account = Fabricate(:account)
|
|
block = AccountDomainBlock.create!(account: account, domain: 'domain')
|
|
Rails.cache.write("exclude_domains_for:#{account.id}", 'domain')
|
|
|
|
block.destroy!
|
|
|
|
expect(Rails.cache.exist?("exclude_domains_for:#{account.id}")).to eq false
|
|
end
|
|
end
|