Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Markech
refinerycms-news
Commits
eabf9df1
Commit
eabf9df1
authored
Sep 26, 2012
by
Uģis Ozols
Browse files
Use Time.utc because we can't use Time.new with arguments in Ruby 1.8.7.
parent
c87c4782
Changes
1
Hide whitespace changes
Inline
Side-by-side
spec/models/refinery/news/item_spec.rb
View file @
eabf9df1
...
...
@@ -8,13 +8,13 @@ module Refinery
let
(
:news_item
)
{
Factory
(
:news_item
)
}
describe
"#archive"
do
let
(
:publish_date
)
{
Time
.
new
(
2012
,
1
,
15
)
}
let
(
:future_date
)
{
Time
.
new
(
2012
,
2
,
15
)
}
let
(
:publish_date
)
{
Time
.
utc
(
2012
,
1
,
15
)
}
let
(
:future_date
)
{
Time
.
utc
(
2012
,
2
,
15
)
}
let
(
:archive_range
)
{
Time
.
parse
(
"01/12"
)
}
it
"should show 5 news items with publish dates in same month"
do
5
.
times
{
Factory
(
:news_item
,
:publish_date
=>
publish_date
)
}
5
.
times
{
Factory
(
:news_item
,
:publish_date
=>
future_date
)
}
2
.
times
{
Factory
(
:news_item
,
:publish_date
=>
future_date
)
}
Refinery
::
News
::
Item
.
by_archive
(
archive_range
).
count
.
should
==
5
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