wip
This commit is contained in:
18
test/models/page_test.rb
Normal file
18
test/models/page_test.rb
Normal file
@ -0,0 +1,18 @@
|
||||
require 'test_helper'
|
||||
|
||||
class PageTest < ActiveSupport::TestCase
|
||||
def test_pages
|
||||
pages = Page.all
|
||||
|
||||
assert pages.count > 10, "Fixture did not load"
|
||||
end
|
||||
|
||||
def test_last_10_order
|
||||
pages = Page.last_ten
|
||||
times = pages.map(&:updated_at)
|
||||
|
||||
assert_equal 10, times.count
|
||||
assert_equal times.sort.reverse, times
|
||||
assert times.last < times.first, 'Sort order should be descending'
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user