BigW Consortium Gitlab

snippet.rb 1.86 KB
Newer Older
Andrew8xx8 committed
1 2 3
module SharedSnippet
  include Spinach::DSL

4
  step 'I have public "Personal snippet one" snippet' do
5 6 7 8
    create(:personal_snippet,
           title: "Personal snippet one",
           content: "Test content",
           file_name: "snippet.rb",
9
           visibility_level: Snippet::PUBLIC,
10 11 12
           author: current_user)
  end

13
  step 'I have private "Personal snippet private" snippet' do
14 15 16 17
    create(:personal_snippet,
           title: "Personal snippet private",
           content: "Provate content",
           file_name: "private_snippet.rb",
18
           visibility_level: Snippet::PRIVATE,
19 20
           author: current_user)
  end
21 22 23 24 25 26 27 28 29 30
  
  step 'I have internal "Personal snippet internal" snippet' do
    create(:personal_snippet,
           title: "Personal snippet internal",
           content: "Provate content",
           file_name: "internal_snippet.rb",
           visibility_level: Snippet::INTERNAL,
           author: current_user)
  end
  
31
  step 'I have a public many lined snippet' do
32
    create(:personal_snippet,
Charles Bushong committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
           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',
51
           visibility_level: Snippet::PUBLIC,
52 53
           author: current_user)
  end
Valery Sizov committed
54 55 56 57 58 59 60 61 62

  step 'There is public "Personal snippet one" snippet' do
    create(:personal_snippet,
           title: "Personal snippet one",
           content: "Test content",
           file_name: "snippet.rb",
           visibility_level: Snippet::PUBLIC,
           author: create(:user))
  end
63
end