summaryrefslogtreecommitdiff
path: root/features/steps
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2014-10-24 11:52:52 +0300
committerValery Sizov <valery@gitlab.com>2014-10-24 11:52:52 +0300
commit705652d62538ec29d125e0ec62bebc99ddc3af71 (patch)
treed93b9d990862b05eb72e8af73a4f6e7ecad60f89 /features/steps
parentc6efa56ee7039882625942ce29ea9fdeeffaa6cd (diff)
downloadgitlab-ce-705652d62538ec29d125e0ec62bebc99ddc3af71.tar.gz
fix for public snippet
Diffstat (limited to 'features/steps')
-rw-r--r--features/steps/shared/snippet.rb9
-rw-r--r--features/steps/snippets/public_snippets.rb17
2 files changed, 26 insertions, 0 deletions
diff --git a/features/steps/shared/snippet.rb b/features/steps/shared/snippet.rb
index 432f32defce..bb596c1620a 100644
--- a/features/steps/shared/snippet.rb
+++ b/features/steps/shared/snippet.rb
@@ -51,4 +51,13 @@ module SharedSnippet
visibility_level: Snippet::PUBLIC,
author: current_user)
end
+
+ 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
end
diff --git a/features/steps/snippets/public_snippets.rb b/features/steps/snippets/public_snippets.rb
new file mode 100644
index 00000000000..956aa4a3e7e
--- /dev/null
+++ b/features/steps/snippets/public_snippets.rb
@@ -0,0 +1,17 @@
+class Spinach::Features::PublicSnippets < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+ include SharedSnippet
+
+ step 'I should see snippet "Personal snippet one"' do
+ page.should have_no_xpath("//i[@class='public-snippet']")
+ end
+
+ step 'I visit snippet page "Personal snippet one"' do
+ visit snippet_path(snippet)
+ end
+
+ def snippet
+ @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one")
+ end
+end