2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
require 'spec_helper'
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
RSpec.describe 'Search Snippets' do
|
2022-11-25 23:54:43 +05:30
|
|
|
before do
|
|
|
|
stub_feature_flags(search_page_vertical_nav: false)
|
|
|
|
end
|
|
|
|
|
2021-02-22 17:27:13 +05:30
|
|
|
it 'user searches for snippets by title' do
|
2017-08-17 22:00:37 +05:30
|
|
|
public_snippet = create(:personal_snippet, :public, title: 'Beginning and Middle')
|
|
|
|
private_snippet = create(:personal_snippet, :private, title: 'Middle and End')
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
sign_in private_snippet.author
|
2017-08-17 22:00:37 +05:30
|
|
|
visit dashboard_snippets_path
|
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
submit_search('Middle')
|
2020-05-24 23:13:21 +05:30
|
|
|
select_search_scope('Titles and Descriptions')
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
expect(page).to have_link(public_snippet.title)
|
|
|
|
expect(page).to have_link(private_snippet.title)
|
|
|
|
end
|
|
|
|
end
|