chat_spec.rb 479 B

123456789101112131415161718
  1. require 'rails_helper'
  2. RSpec.describe Chat, type: :model do
  3. describe 'website whitelisting' do
  4. let(:chat) { create(:chat, whitelisted_websites: 'zammad.org') }
  5. it 'detects whitelisted website' do
  6. result = chat.website_whitelisted?('https://www.zammad.org')
  7. expect(result).to be true
  8. end
  9. it 'detects non-whitelisted website' do
  10. result = chat.website_whitelisted?('https://www.zammad.com')
  11. expect(result).to be false
  12. end
  13. end
  14. end