ぼざクリタグ広場 https://hub.nizika.monster
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

28 lines
880 B

  1. require 'rails_helper'
  2. RSpec.describe 'Wiki body search', type: :request do
  3. let!(:user) { create_member_user! }
  4. it 'searches wiki pages by body text' do
  5. pending '#336 で対応予定'
  6. Wiki::Commit.create_content!(
  7. tag_name: TagName.create!(name: 'wiki_body_search_hit'),
  8. body: 'unique body keyword for wiki search',
  9. created_by_user: user,
  10. message: 'init')
  11. Wiki::Commit.create_content!(
  12. tag_name: TagName.create!(name: 'wiki_body_search_miss'),
  13. body: 'ordinary body',
  14. created_by_user: user,
  15. message: 'init')
  16. get '/wiki/search', params: { body: 'unique body keyword' }
  17. expect(response).to have_http_status(:ok)
  18. expect(json.map { |page| page['title'] }).to include('wiki_body_search_hit')
  19. expect(json.map { |page| page['title'] }).not_to include('wiki_body_search_miss')
  20. end
  21. end