2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2020-02-19 17:07:52 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2020-06-18 11:51:25 +00:00
|
|
|
RSpec.describe 'Public Knowledge Base answer', type: :system, authenticated_as: false do
|
2020-02-19 17:07:52 +00:00
|
|
|
include_context 'basic Knowledge Base'
|
|
|
|
|
|
|
|
context 'video content' do
|
|
|
|
|
|
|
|
before do
|
|
|
|
published_answer_with_video
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows video player' do
|
|
|
|
visit help_answer_path(primary_locale.system_locale.locale, category, published_answer_with_video)
|
|
|
|
|
|
|
|
iframe = find('iframe')
|
2020-03-06 08:27:42 +00:00
|
|
|
expect(iframe['src']).to start_with('https://www.youtube.com/embed/')
|
2020-02-19 17:07:52 +00:00
|
|
|
end
|
|
|
|
end
|
2021-08-16 08:20:07 +00:00
|
|
|
|
|
|
|
context 'tags' do
|
|
|
|
before do
|
|
|
|
visit help_answer_path(locale_name, category, published_answer_with_tag)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows an associated tag' do
|
|
|
|
expect(page).to have_css('.tags a', text: published_answer_tag_name)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'links to tag page' do
|
|
|
|
click '.tags a'
|
|
|
|
|
|
|
|
expect(current_url).to end_with help_tag_path(locale_name, published_answer_tag_name)
|
|
|
|
end
|
|
|
|
end
|
2020-02-19 17:07:52 +00:00
|
|
|
end
|