BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
1 deletion
+11
-1
snippet.rb
app/models/snippet.rb
+1
-0
show.html.haml
app/views/snippets/show.html.haml
+1
-1
snippet_spec.rb
spec/models/snippet_spec.rb
+1
-0
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
# created_at :datetime
# updated_at :datetime
# file_name :string(255)
# expires_at :datetime
#
app/views/snippets/show.html.haml
View file @
b6cdd1c8
...
...
@@ -23,4 +23,4 @@
-
else
%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
# created_at :datetime
# updated_at :datetime
# file_name :string(255)
# expires_at :datetime
#
spec/requests/snippets_spec.rb
View file @
b6cdd1c8
...
...
@@ -23,6 +23,14 @@ describe "Snippets" do
it
{
should
have_content
(
@snippet
.
project
.
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
before
do
# 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