2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 03:56:52 -04:00
|
|
|
require 'spec_helper'
|
2016-11-15 02:10:43 -05:00
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
describe 'Search Snippets' do
|
|
|
|
it 'User searches for snippets by title' do
|
2016-11-15 02:10:43 -05:00
|
|
|
public_snippet = create(:personal_snippet, :public, title: 'Beginning and Middle')
|
|
|
|
private_snippet = create(:personal_snippet, :private, title: 'Middle and End')
|
|
|
|
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in private_snippet.author
|
2016-11-15 02:10:43 -05:00
|
|
|
visit dashboard_snippets_path
|
|
|
|
|
2019-08-30 05:49:14 -04:00
|
|
|
submit_search('Middle')
|
|
|
|
select_search_scope('Titles and Filenames')
|
2016-11-15 02:10:43 -05:00
|
|
|
|
|
|
|
expect(page).to have_link(public_snippet.title)
|
|
|
|
expect(page).to have_link(private_snippet.title)
|
|
|
|
end
|
|
|
|
end
|