answer_spec.rb 981 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe 'Public Knowledge Base answer', type: :system, authenticated_as: false do
  4. include_context 'basic Knowledge Base'
  5. context 'video content' do
  6. before do
  7. published_answer_with_video
  8. end
  9. it 'shows video player' do
  10. visit help_answer_path(primary_locale.system_locale.locale, category, published_answer_with_video)
  11. iframe = find('iframe')
  12. expect(iframe['src']).to start_with('https://www.youtube.com/embed/')
  13. end
  14. end
  15. context 'tags' do
  16. before do
  17. visit help_answer_path(locale_name, category, published_answer_with_tag)
  18. end
  19. it 'shows an associated tag' do
  20. expect(page).to have_css('.tags a', text: published_answer_tag_name)
  21. end
  22. it 'links to tag page' do
  23. click '.tags a'
  24. expect(current_url).to end_with help_tag_path(locale_name, published_answer_tag_name)
  25. end
  26. end
  27. end