BigW Consortium Gitlab

snippet_search.rb 1.51 KB
Newer Older
1 2 3 4 5 6 7 8
class Spinach::Features::SnippetSearch < Spinach::FeatureSteps
  include SharedAuthentication
  include SharedPaths
  include SharedSnippet
  include SharedUser
  include SharedSearch

  step 'I search for "snippet" in snippet titles' do
Charles Bushong committed
9
    search_snippet_titles 'snippet'
10 11 12
  end

  step 'I search for "snippet private" in snippet titles' do
Charles Bushong committed
13
    search_snippet_titles 'snippet private'
14 15 16
  end

  step 'I search for "line seven" in snippet contents' do
Charles Bushong committed
17
    search_snippet_contents 'line seven'
18 19 20
  end

  step 'I should see "line seven" in results' do
21
    expect(page).to have_content 'line seven'
22 23 24
  end

  step 'I should see "line four" in results' do
25
    expect(page).to have_content 'line four'
26 27 28
  end

  step 'I should see "line ten" in results' do
29
    expect(page).to have_content 'line ten'
30 31 32
  end

  step 'I should not see "line eleven" in results' do
33
    expect(page).not_to have_content 'line eleven'
34 35 36
  end

  step 'I should not see "line three" in results' do
37
    expect(page).not_to have_content 'line three'
38 39
  end

40
  step 'I should see "Personal snippet one" in results' do
41
    expect(page).to have_content 'Personal snippet one'
42 43
  end

44
  step 'I should see "Personal snippet private" in results' do
45
    expect(page).to have_content 'Personal snippet private'
46 47
  end

48
  step 'I should not see "Personal snippet one" in results' do
49
    expect(page).not_to have_content 'Personal snippet one'
50 51
  end

52
  step 'I should not see "Personal snippet private" in results' do
53
    expect(page).not_to have_content 'Personal snippet private'
54 55 56
  end

end