diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-09 10:31:21 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-09 10:31:21 +0300 |
commit | 9e4a40982e25b31c0654b295fdf16d9aab2013f5 (patch) | |
tree | 9762e29c430952db283b577e001ea6d8f490d371 /features/steps/shared | |
parent | 002ce69e8fb1b1767967017175c7cfe66ec9d0ae (diff) | |
parent | 4561a09c69b9769ebdbbf7cb9a3ed8f8cc03651b (diff) | |
download | gitlab-ce-9e4a40982e25b31c0654b295fdf16d9aab2013f5.tar.gz |
Merge pull request #7646 from bushong1/snippet-search3
Adding in snippet search functionality
Diffstat (limited to 'features/steps/shared')
-rw-r--r-- | features/steps/shared/search.rb | 11 | ||||
-rw-r--r-- | features/steps/shared/snippet.rb | 23 |
2 files changed, 34 insertions, 0 deletions
diff --git a/features/steps/shared/search.rb b/features/steps/shared/search.rb new file mode 100644 index 00000000000..6c3d601763d --- /dev/null +++ b/features/steps/shared/search.rb @@ -0,0 +1,11 @@ +module SharedSearch + include Spinach::DSL + + def search_snippet_contents(query) + visit "/search?search=#{URI::encode(query)}&snippets=true&scope=snippet_blobs" + end + + def search_snippet_titles(query) + visit "/search?search=#{URI::encode(query)}&snippets=true&scope=snippet_titles" + end +end diff --git a/features/steps/shared/snippet.rb b/features/steps/shared/snippet.rb index 543e43196a5..c64299ae6f3 100644 --- a/features/steps/shared/snippet.rb +++ b/features/steps/shared/snippet.rb @@ -18,4 +18,27 @@ module SharedSnippet private: true, author: current_user) end + And 'I have a public many lined snippet' do + create(:personal_snippet, + title: 'Many lined snippet', + content: <<-END.gsub(/^\s+\|/, ''), + |line one + |line two + |line three + |line four + |line five + |line six + |line seven + |line eight + |line nine + |line ten + |line eleven + |line twelve + |line thirteen + |line fourteen + END + file_name: 'many_lined_snippet.rb', + private: true, + author: current_user) + end end |