linking_knowledge_base_answer_spec.rb 873 B

1234567891011121314151617181920212223242526272829
  1. require 'rails_helper'
  2. RSpec.describe 'linking Knowledge Base answer', type: :system, authenticated: true, searchindex: true do
  3. include_context 'basic Knowledge Base'
  4. before do
  5. configure_elasticsearch(required: true, rebuild: true) do
  6. published_answer
  7. end
  8. # refresh page to make sure it reflects updated settings
  9. refresh
  10. end
  11. it do
  12. ticket = create :ticket, group: Group.find_by(name: 'Users')
  13. visit "#ticket/zoom/#{ticket.id}"
  14. find(:css, '.active .link_kb_answers .js-add').click
  15. target_translation = published_answer.translations.first
  16. find(:css, '.active .link_kb_answers .js-input').send_keys target_translation.title
  17. find(:css, %(.active .link_kb_answers li[data-value="#{target_translation.id}"])).click
  18. expect(find(:css, '.active .link_kb_answers ol')).to have_text target_translation.title
  19. end
  20. end