summaryrefslogtreecommitdiff
path: root/features/steps
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2014-10-08 16:44:25 +0300
committerValery Sizov <valery@gitlab.com>2014-10-09 17:09:53 +0300
commit47f539f5a6a930b2cfd4f9834b4d1bd5e1c180cb (patch)
tree0b528d431aa1625d92d3598f6a86ef8aa93b6491 /features/steps
parentf7dc15c6bdb75a5f611c389ece3fe251f94a2d8f (diff)
downloadgitlab-ce-47f539f5a6a930b2cfd4f9834b4d1bd5e1c180cb.tar.gz
Snippets: public/internal/private
Diffstat (limited to 'features/steps')
-rw-r--r--features/steps/shared/snippet.rb16
-rw-r--r--features/steps/snippets/discover.rb4
-rw-r--r--features/steps/snippets/user.rb14
3 files changed, 31 insertions, 3 deletions
diff --git a/features/steps/shared/snippet.rb b/features/steps/shared/snippet.rb
index 5a27e8750cf..432f32defce 100644
--- a/features/steps/shared/snippet.rb
+++ b/features/steps/shared/snippet.rb
@@ -6,7 +6,7 @@ module SharedSnippet
title: "Personal snippet one",
content: "Test content",
file_name: "snippet.rb",
- private: false,
+ visibility_level: Snippet::PUBLIC,
author: current_user)
end
@@ -15,9 +15,19 @@ module SharedSnippet
title: "Personal snippet private",
content: "Provate content",
file_name: "private_snippet.rb",
- private: true,
+ visibility_level: Snippet::PRIVATE,
author: current_user)
end
+
+ 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
+
step 'I have a public many lined snippet' do
create(:personal_snippet,
title: 'Many lined snippet',
@@ -38,7 +48,7 @@ module SharedSnippet
|line fourteen
END
file_name: 'many_lined_snippet.rb',
- private: true,
+ visibility_level: Snippet::PUBLIC,
author: current_user)
end
end
diff --git a/features/steps/snippets/discover.rb b/features/steps/snippets/discover.rb
index 42bccafcc84..2667c1e3d44 100644
--- a/features/steps/snippets/discover.rb
+++ b/features/steps/snippets/discover.rb
@@ -7,6 +7,10 @@ class Spinach::Features::SnippetsDiscover < Spinach::FeatureSteps
page.should have_content "Personal snippet one"
end
+ step 'I should see "Personal snippet internal" in snippets' do
+ page.should have_content "Personal snippet internal"
+ end
+
step 'I should not see "Personal snippet private" in snippets' do
page.should_not have_content "Personal snippet private"
end
diff --git a/features/steps/snippets/user.rb b/features/steps/snippets/user.rb
index c41bc436142..866f637ab6c 100644
--- a/features/steps/snippets/user.rb
+++ b/features/steps/snippets/user.rb
@@ -15,6 +15,10 @@ class Spinach::Features::SnippetsUser < Spinach::FeatureSteps
page.should have_content "Personal snippet private"
end
+ step 'I should see "Personal snippet internal" in snippets' do
+ page.should have_content "Personal snippet internal"
+ end
+
step 'I should not see "Personal snippet one" in snippets' do
page.should_not have_content "Personal snippet one"
end
@@ -23,6 +27,10 @@ class Spinach::Features::SnippetsUser < Spinach::FeatureSteps
page.should_not have_content "Personal snippet private"
end
+ step 'I should not see "Personal snippet internal" in snippets' do
+ page.should_not have_content "Personal snippet internal"
+ end
+
step 'I click "Internal" filter' do
within('.nav-stacked') do
click_link "Internal"
@@ -35,6 +43,12 @@ class Spinach::Features::SnippetsUser < Spinach::FeatureSteps
end
end
+ step 'I click "Public" filter' do
+ within('.nav-stacked') do
+ click_link "Public"
+ end
+ end
+
def snippet
@snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one")
end