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
Léo-Paul Géneau
gitlab-ce
Commits
94d8698a
Commit
94d8698a
authored
Oct 27, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_raw_view_snippets' into 'master'
Fix raw view snippets See merge request !1220
parents
f9885c0c
40c8f159
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
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/steps/snippets/public_snippets.rb
features/steps/snippets/public_snippets.rb
+8
-0
No files found.
app/controllers/snippets_controller.rb
View file @
94d8698a
...
@@ -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
,
:show
]
skip_before_filter
:authenticate_user!
,
only:
[
:index
,
:user_index
,
:show
,
:raw
]
respond_to
:html
respond_to
:html
...
...
features/snippets/public_snippets.feature
View file @
94d8698a
...
@@ -3,3 +3,8 @@ Feature: Public snippets
...
@@ -3,3 +3,8 @@ Feature: Public snippets
Given
There is public
"Personal snippet one"
snippet
Given
There is public
"Personal snippet one"
snippet
And
I visit snippet page
"Personal snippet one"
And
I visit snippet page
"Personal snippet one"
Then
I should see snippet
"Personal snippet one"
Then
I should see snippet
"Personal snippet one"
Scenario
:
Unauthenticated user should see raw public snippets
Given
There is public
"Personal snippet one"
snippet
And
I visit snippet raw page
"Personal snippet one"
Then
I should see raw snippet
"Personal snippet one"
features/steps/snippets/public_snippets.rb
View file @
94d8698a
...
@@ -7,10 +7,18 @@ class Spinach::Features::PublicSnippets < Spinach::FeatureSteps
...
@@ -7,10 +7,18 @@ class Spinach::Features::PublicSnippets < Spinach::FeatureSteps
page
.
should
have_no_xpath
(
"//i[@class='public-snippet']"
)
page
.
should
have_no_xpath
(
"//i[@class='public-snippet']"
)
end
end
step
'I should see raw snippet "Personal snippet one"'
do
page
.
should
have_text
(
snippet
.
content
)
end
step
'I visit snippet page "Personal snippet one"'
do
step
'I visit snippet page "Personal snippet one"'
do
visit
snippet_path
(
snippet
)
visit
snippet_path
(
snippet
)
end
end
step
'I visit snippet raw page "Personal snippet one"'
do
visit
raw_snippet_path
(
snippet
)
end
def
snippet
def
snippet
@snippet
||=
PersonalSnippet
.
find_by!
(
title:
"Personal snippet one"
)
@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