test expired snippets
This commit is contained in:
parent
01f72bfa83
commit
b6cdd1c819
4 changed files with 11 additions and 1 deletions
|
@ -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
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -23,4 +23,4 @@
|
||||||
|
|
||||||
- else
|
- else
|
||||||
%h2
|
%h2
|
||||||
Sorry, this snipped is no longer exists
|
Sorry, this snippet is no longer exists
|
||||||
|
|
|
@ -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
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue