sitios de testeo
This commit is contained in:
parent
a421a79840
commit
42923c4e04
7 changed files with 56 additions and 0 deletions
2
test/fixtures/site_with_relationships/README.md
vendored
Normal file
2
test/fixtures/site_with_relationships/README.md
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
This is site where posts can have many authors and viceversa and posts
|
||||
can be replies to others.
|
2
test/fixtures/site_with_relationships/_config.yml
vendored
Normal file
2
test/fixtures/site_with_relationships/_config.yml
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
locales:
|
||||
- en
|
9
test/fixtures/site_with_relationships/_data/layouts/author.yml
vendored
Normal file
9
test/fixtures/site_with_relationships/_data/layouts/author.yml
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
title:
|
||||
type: 'string'
|
||||
required: true
|
||||
posts:
|
||||
type: 'has_and_belongs_to_many'
|
||||
inverse: 'authors'
|
||||
filter:
|
||||
layout: 'post'
|
23
test/fixtures/site_with_relationships/_data/layouts/post.yml
vendored
Normal file
23
test/fixtures/site_with_relationships/_data/layouts/post.yml
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
title:
|
||||
type: 'string'
|
||||
required: true
|
||||
authors:
|
||||
type: 'has_and_belongs_to_many'
|
||||
inverse: 'posts'
|
||||
filter:
|
||||
layout: 'author'
|
||||
posts:
|
||||
type: 'has_many'
|
||||
inverse: 'in_reply_to'
|
||||
filter:
|
||||
layout: 'post'
|
||||
in_reply_to:
|
||||
type: 'belongs_to'
|
||||
inverse: 'posts'
|
||||
filter:
|
||||
layout: 'post'
|
||||
recommended_posts:
|
||||
type: 'related_posts'
|
||||
filter:
|
||||
layout: 'post'
|
0
test/fixtures/site_with_relationships/_en/.keep
vendored
Normal file
0
test/fixtures/site_with_relationships/_en/.keep
vendored
Normal file
1
test/fixtures/site_with_relationships/_posts
vendored
Symbolic link
1
test/fixtures/site_with_relationships/_posts
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
_en
|
19
test/models/metadata_test.rb
Normal file
19
test/models/metadata_test.rb
Normal file
|
@ -0,0 +1,19 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module MetadataTest
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
setup do
|
||||
name = SecureRandom.hex
|
||||
# TODO: Poder cambiar el nombre
|
||||
FileUtils.cp_r(Rails.root.join('test', 'fixtures', 'site_with_relationships'), Rails.root.join('_sites', name))
|
||||
|
||||
@site = create :site, name: name
|
||||
end
|
||||
|
||||
teardown do
|
||||
@site&.destroy
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue