Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
8a7b864e
Commit
8a7b864e
authored
Oct 24, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_public_snippets' into 'master'
Fix public snippets See merge request !1214
parents
8157c6b8
705652d6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
2 deletions
+33
-2
app/controllers/snippets_controller.rb
app/controllers/snippets_controller.rb
+1
-1
features/snippets/public_snippets.feature
features/snippets/public_snippets.feature
+5
-0
features/snippets/snippets.feature
features/snippets/snippets.feature
+1
-1
features/steps/shared/snippet.rb
features/steps/shared/snippet.rb
+9
-0
features/steps/snippets/public_snippets.rb
features/steps/snippets/public_snippets.rb
+17
-0
No files found.
app/controllers/snippets_controller.rb
View file @
8a7b864e
...
@@ -9,7 +9,7 @@ class SnippetsController < ApplicationController
...
@@ -9,7 +9,7 @@ class SnippetsController < ApplicationController
before_filter
:set_title
before_filter
:set_title
skip_before_filter
:authenticate_user!
,
only:
[
:index
,
:user_index
]
skip_before_filter
:authenticate_user!
,
only:
[
:index
,
:user_index
,
:show
]
respond_to
:html
respond_to
:html
...
...
features/snippets/public_snippets.feature
0 → 100644
View file @
8a7b864e
Feature
:
Public snippets
Scenario
:
Unauthenticated user should see public snippets
Given
There is public
"Personal snippet one"
snippet
And
I visit snippet page
"Personal snippet one"
Then
I should see snippet
"Personal snippet one"
features/snippets/snippets.feature
View file @
8a7b864e
...
@@ -25,4 +25,4 @@ Feature: Snippets
...
@@ -25,4 +25,4 @@ Feature: Snippets
Scenario
:
I
destroy
"Personal snippet one"
Scenario
:
I
destroy
"Personal snippet one"
Given
I visit snippet page
"Personal snippet one"
Given
I visit snippet page
"Personal snippet one"
And
I click link
"Destroy"
And
I click link
"Destroy"
Then
I should not see
"Personal snippet one"
in snippets
Then
I should not see
"Personal snippet one"
in snippets
\ No newline at end of file
features/steps/shared/snippet.rb
View file @
8a7b864e
...
@@ -51,4 +51,13 @@ module SharedSnippet
...
@@ -51,4 +51,13 @@ module SharedSnippet
visibility_level:
Snippet
::
PUBLIC
,
visibility_level:
Snippet
::
PUBLIC
,
author:
current_user
)
author:
current_user
)
end
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
end
features/steps/snippets/public_snippets.rb
0 → 100644
View file @
8a7b864e
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment