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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
b6cdd1c8
Commit
b6cdd1c8
authored
Oct 28, 2011
by
Nihad Abbasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test expired snippets
parent
01f72bfa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
1 deletion
+11
-1
app/models/snippet.rb
app/models/snippet.rb
+1
-0
app/views/snippets/show.html.haml
app/views/snippets/show.html.haml
+1
-1
spec/models/snippet_spec.rb
spec/models/snippet_spec.rb
+1
-0
spec/requests/snippets_spec.rb
spec/requests/snippets_spec.rb
+8
-0
No files found.
app/models/snippet.rb
View file @
b6cdd1c8
...
@@ -53,5 +53,6 @@ end
...
@@ -53,5 +53,6 @@ end
# created_at :datetime
# created_at :datetime
# updated_at :datetime
# updated_at :datetime
# file_name :string(255)
# file_name :string(255)
# expires_at :datetime
#
#
app/views/snippets/show.html.haml
View file @
b6cdd1c8
...
@@ -23,4 +23,4 @@
...
@@ -23,4 +23,4 @@
-
else
-
else
%h2
%h2
Sorry, this snippe
d
is no longer exists
Sorry, this snippe
t
is no longer exists
spec/models/snippet_spec.rb
View file @
b6cdd1c8
...
@@ -26,5 +26,6 @@ end
...
@@ -26,5 +26,6 @@ end
# created_at :datetime
# created_at :datetime
# updated_at :datetime
# updated_at :datetime
# file_name :string(255)
# file_name :string(255)
# expires_at :datetime
#
#
spec/requests/snippets_spec.rb
View file @
b6cdd1c8
...
@@ -23,6 +23,14 @@ describe "Snippets" do
...
@@ -23,6 +23,14 @@ describe "Snippets" do
it
{
should
have_content
(
@snippet
.
project
.
name
)
}
it
{
should
have_content
(
@snippet
.
project
.
name
)
}
it
{
should
have_content
(
@snippet
.
author
.
name
)
}
it
{
should
have_content
(
@snippet
.
author
.
name
)
}
it
"doesn't show expired snippets"
do
@snippet
.
update_attribute
(
:expires_at
,
1
.
day
.
ago
.
to_time
)
visit
project_snippet_path
(
project
,
@snippet
)
page
.
should
have_content
(
"Sorry, this snippet is no longer exists"
)
page
.
should_not
have_content
(
@snippet
.
title
)
page
.
should_not
have_content
(
@snippet
.
content
)
end
describe
"Destroy"
do
describe
"Destroy"
do
before
do
before
do
# admin access to remove snippet
# admin access to remove snippet
...
...
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