mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-24 07:26:21 +00:00
This commit is contained in:
parent
1256258d76
commit
74795069ac
2 changed files with 10 additions and 7 deletions
|
@ -9,7 +9,8 @@ class MetadataDocumentDateTest < ActiveSupport::TestCase
|
|||
@name = 'date'
|
||||
@layout = build(:layout, site: @site)
|
||||
@post = build(:post, layout: @layout, site: @site, document: @document)
|
||||
@metadata = MetadataDocumentDate.new(site: @site, document: @document, name: @name, type: 'date', layout: @layout, post: @post)
|
||||
@metadata = MetadataDocumentDate.new(site: @site, document: @document, name: @name, type: 'date', layout: @layout,
|
||||
post: @post)
|
||||
end
|
||||
|
||||
# Una fecha al azar en el pasado o en el futuro
|
||||
|
@ -45,7 +46,8 @@ class MetadataDocumentDateTest < ActiveSupport::TestCase
|
|||
default = random_value
|
||||
|
||||
@layout = build(:layout, site: @site, metadata: { @name => { 'default' => { I18n.locale.to_s => default } } })
|
||||
@metadata = MetadataDocumentDate.new(site: @site, document: @document, name: @name, type: 'document_date', layout: @layout)
|
||||
@metadata = MetadataDocumentDate.new(site: @site, document: @document, name: @name, type: 'document_date',
|
||||
layout: @layout)
|
||||
|
||||
assert_equal default, @metadata.default_value
|
||||
end
|
||||
|
@ -60,7 +62,8 @@ class MetadataDocumentDateTest < ActiveSupport::TestCase
|
|||
|
||||
test 'se pueden hacer privados' do
|
||||
@layout = build(:layout, site: @site, metadata: { @name => { 'private' => true } })
|
||||
@metadata = MetadataDocumentDate.new(site: @site, document: @document, name: @name, type: 'document_date', layout: @layout)
|
||||
@metadata = MetadataDocumentDate.new(site: @site, document: @document, name: @name, type: 'document_date',
|
||||
layout: @layout)
|
||||
|
||||
assert @metadata.private?
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue