2013-03-25 05:14:12 -04:00
|
|
|
module SharedSnippet
|
|
|
|
include Spinach::DSL
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I have public "Personal snippet one" snippet' do
|
2013-03-24 18:17:38 -04:00
|
|
|
create(:personal_snippet,
|
|
|
|
title: "Personal snippet one",
|
|
|
|
content: "Test content",
|
|
|
|
file_name: "snippet.rb",
|
2014-10-08 09:44:25 -04:00
|
|
|
visibility_level: Snippet::PUBLIC,
|
2013-03-24 18:17:38 -04:00
|
|
|
author: current_user)
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I have private "Personal snippet private" snippet' do
|
2013-03-24 18:17:38 -04:00
|
|
|
create(:personal_snippet,
|
|
|
|
title: "Personal snippet private",
|
|
|
|
content: "Provate content",
|
|
|
|
file_name: "private_snippet.rb",
|
2014-10-08 09:44:25 -04:00
|
|
|
visibility_level: Snippet::PRIVATE,
|
2013-03-24 18:17:38 -04:00
|
|
|
author: current_user)
|
|
|
|
end
|
2014-10-08 09:44:25 -04:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I have a public many lined snippet' do
|
2014-09-05 13:30:55 -04:00
|
|
|
create(:personal_snippet,
|
2014-09-05 13:51:23 -04:00
|
|
|
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',
|
2014-10-08 09:44:25 -04:00
|
|
|
visibility_level: Snippet::PUBLIC,
|
2014-09-05 13:30:55 -04:00
|
|
|
author: current_user)
|
|
|
|
end
|
2014-10-24 04:52:52 -04:00
|
|
|
|
|
|
|
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
|
2013-03-24 18:17:38 -04:00
|
|
|
end
|