Convert /instances/*
controller specs to request specs (#27988)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
718c95e7af
commit
876f5b1d12
20 changed files with 349 additions and 192 deletions
|
@ -19,7 +19,19 @@ class Api::V1::Instances::DomainBlocksController < Api::V1::Instances::BaseContr
|
|||
private
|
||||
|
||||
def require_enabled_api!
|
||||
head 404 unless Setting.show_domain_blocks == 'all' || (Setting.show_domain_blocks == 'users' && user_signed_in?)
|
||||
head 404 unless api_enabled?
|
||||
end
|
||||
|
||||
def api_enabled?
|
||||
show_domain_blocks_for_all? || show_domain_blocks_to_user?
|
||||
end
|
||||
|
||||
def show_domain_blocks_for_all?
|
||||
Setting.show_domain_blocks == 'all'
|
||||
end
|
||||
|
||||
def show_domain_blocks_to_user?
|
||||
Setting.show_domain_blocks == 'users' && user_signed_in?
|
||||
end
|
||||
|
||||
def set_domain_blocks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue