2013-02-05 14:16:51 -05:00
|
|
|
Fabricator(:post) do
|
|
|
|
user
|
|
|
|
topic {|attrs| Fabricate(:topic, user: attrs[:user] ) }
|
2013-02-25 11:42:20 -05:00
|
|
|
raw "Hello world"
|
2015-09-21 18:50:52 -04:00
|
|
|
post_type Post.types[:regular]
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|
|
|
|
|
2014-04-11 16:07:39 -04:00
|
|
|
Fabricator(:post_with_long_raw_content, from: :post) do
|
|
|
|
raw 'This is a sample post with semi-long raw content. The raw content is also more than
|
|
|
|
two hundred characters to satisfy any test conditions that require content longer
|
|
|
|
than the typical test post raw content.'
|
|
|
|
end
|
|
|
|
|
2013-02-05 14:16:51 -05:00
|
|
|
Fabricator(:post_with_youtube, from: :post) do
|
2015-09-29 12:51:26 -04:00
|
|
|
raw 'http://www.youtube.com/watch?v=9bZkp7q19f0'
|
2013-04-10 03:52:38 -04:00
|
|
|
cooked '<p><a href="http://www.youtube.com/watch?v=9bZkp7q19f0" class="onebox" target="_blank">http://www.youtube.com/watch?v=9bZkp7q19f0</a></p>'
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
Fabricator(:old_post, from: :post) do
|
|
|
|
topic {|attrs| Fabricate(:topic, user: attrs[:user], created_at: (DateTime.now - 100) ) }
|
|
|
|
created_at (DateTime.now - 100)
|
|
|
|
end
|
|
|
|
|
|
|
|
Fabricator(:moderator_post, from: :post) do
|
|
|
|
user
|
|
|
|
topic {|attrs| Fabricate(:topic, user: attrs[:user] ) }
|
2013-03-18 16:03:46 -04:00
|
|
|
post_type Post.types[:moderator_action]
|
2013-02-25 11:42:20 -05:00
|
|
|
raw "Hello world"
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
Fabricator(:basic_reply, from: :post) do
|
|
|
|
user(:coding_horror)
|
|
|
|
reply_to_post_number 1
|
|
|
|
topic
|
|
|
|
raw 'this reply has no quotes'
|
|
|
|
end
|
|
|
|
|
|
|
|
Fabricator(:reply, from: :post) do
|
|
|
|
user(:coding_horror)
|
|
|
|
topic
|
|
|
|
raw '
|
|
|
|
[quote="Evil Trout, post:1"]hello[/quote]
|
|
|
|
Hmmm!
|
|
|
|
'
|
|
|
|
end
|
|
|
|
|
2015-08-05 06:57:31 -04:00
|
|
|
Fabricator(:post_with_plenty_of_images, from: :post) do
|
2013-07-07 19:39:08 -04:00
|
|
|
cooked '
|
|
|
|
<aside class="quote"><img src="/uploads/default/1/1234567890123456.jpg"></aside>
|
|
|
|
<div class="onebox-result"><img src="/uploads/default/1/1234567890123456.jpg"></div>
|
2014-05-12 06:07:05 -04:00
|
|
|
<div class="onebox"><img src="/uploads/default/1/1234567890123456.jpg"></div>
|
2015-12-22 17:36:21 -05:00
|
|
|
<p>With an emoji! <img src="//cdn.discourse.org/meta/images/emoji/twitter/smile.png?v=1" title=":smile:" class="emoji" alt="smile" width="72" height="72"></p>
|
2013-07-07 19:39:08 -04:00
|
|
|
'
|
|
|
|
end
|
|
|
|
|
2013-07-21 18:37:23 -04:00
|
|
|
Fabricator(:post_with_uploaded_image, from: :post) do
|
2015-09-29 12:51:26 -04:00
|
|
|
raw '<img src="/uploads/default/2/3456789012345678.png" width="1500" height="2000">'
|
2013-07-07 19:39:08 -04:00
|
|
|
end
|
|
|
|
|
2013-07-10 16:59:07 -04:00
|
|
|
Fabricator(:post_with_an_attachment, from: :post) do
|
2015-09-29 12:51:26 -04:00
|
|
|
raw '<a class="attachment" href="/uploads/default/186/66b3ed1503efc936.zip">archive.zip</a>'
|
2013-07-10 16:59:07 -04:00
|
|
|
end
|
|
|
|
|
2013-07-07 19:39:08 -04:00
|
|
|
Fabricator(:post_with_unsized_images, from: :post) do
|
2015-09-29 12:51:26 -04:00
|
|
|
raw '
|
2013-07-07 19:39:08 -04:00
|
|
|
<img src="http://foo.bar/image.png">
|
|
|
|
<img src="/uploads/default/1/1234567890123456.jpg">
|
|
|
|
'
|
|
|
|
end
|
|
|
|
|
2013-11-25 12:36:13 -05:00
|
|
|
Fabricator(:post_with_image_urls, from: :post) do
|
2015-09-29 12:51:26 -04:00
|
|
|
raw '
|
2013-11-25 12:36:13 -05:00
|
|
|
<img src="http://foo.bar/image.png">
|
|
|
|
<img src="http://domain.com/picture.jpg" width="50" height="42">
|
|
|
|
'
|
2013-07-07 19:39:08 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
Fabricator(:post_with_large_image, from: :post) do
|
2015-09-29 12:51:26 -04:00
|
|
|
raw '<img src="/uploads/default/1/1234567890123456.jpg">'
|
2013-07-07 19:39:08 -04:00
|
|
|
end
|
|
|
|
|
2014-11-03 16:03:06 -05:00
|
|
|
Fabricator(:post_with_large_image_and_title, from: :post) do
|
2015-09-29 12:51:26 -04:00
|
|
|
raw '<img src="/uploads/default/1/1234567890123456.jpg" title="WAT">'
|
2014-11-03 16:03:06 -05:00
|
|
|
end
|
|
|
|
|
2016-03-09 22:50:07 -05:00
|
|
|
Fabricator(:post_with_large_image_on_subfolder, from: :post) do
|
|
|
|
raw '<img src="/subfolder/uploads/default/1/1234567890123456.jpg">'
|
|
|
|
end
|
|
|
|
|
2013-11-05 13:04:47 -05:00
|
|
|
Fabricator(:post_with_uploads, from: :post) do
|
2015-09-29 12:51:26 -04:00
|
|
|
raw '
|
2013-11-05 13:04:47 -05:00
|
|
|
<a href="/uploads/default/2/2345678901234567.jpg">Link</a>
|
|
|
|
<img src="/uploads/default/1/1234567890123456.jpg">
|
|
|
|
'
|
|
|
|
end
|
|
|
|
|
|
|
|
Fabricator(:post_with_uploads_and_links, from: :post) do
|
2015-09-29 12:51:26 -04:00
|
|
|
raw '
|
2013-11-05 13:04:47 -05:00
|
|
|
<a href="/uploads/default/2/2345678901234567.jpg">Link</a>
|
|
|
|
<img src="/uploads/default/1/1234567890123456.jpg">
|
|
|
|
<a href="http://www.google.com">Google</a>
|
|
|
|
<img src="http://foo.bar/image.png">
|
2016-01-06 15:54:01 -05:00
|
|
|
<a class="attachment" href="/uploads/default/original/1X/af2c2618032c679333bebf745e75f9088748d737.txt">text.txt</a> (20 Bytes)
|
2013-11-05 13:04:47 -05:00
|
|
|
'
|
|
|
|
end
|
|
|
|
|
2013-02-05 14:16:51 -05:00
|
|
|
Fabricator(:post_with_external_links, from: :post) do
|
|
|
|
user
|
|
|
|
topic
|
|
|
|
raw "
|
|
|
|
Here's a link to twitter: http://twitter.com
|
|
|
|
And a link to google: http://google.com
|
|
|
|
And a markdown link: [forumwarz](http://forumwarz.com)
|
|
|
|
And a markdown link with a period after it [codinghorror](http://www.codinghorror.com/blog).
|
|
|
|
"
|
|
|
|
end
|
2013-04-03 13:25:52 -04:00
|
|
|
|
|
|
|
Fabricator(:private_message_post, from: :post) do
|
|
|
|
user
|
|
|
|
topic do |attrs|
|
|
|
|
Fabricate( :private_message_topic,
|
|
|
|
user: attrs[:user],
|
|
|
|
created_at: attrs[:created_at],
|
2013-04-16 16:56:18 -04:00
|
|
|
subtype: TopicSubtype.user_to_user,
|
2013-04-03 13:25:52 -04:00
|
|
|
topic_allowed_users: [
|
|
|
|
Fabricate.build(:topic_allowed_user, user_id: attrs[:user].id),
|
|
|
|
Fabricate.build(:topic_allowed_user, user_id: Fabricate(:user).id)
|
|
|
|
]
|
|
|
|
)
|
|
|
|
end
|
|
|
|
raw "Ssshh! This is our secret conversation!"
|
2013-04-10 03:52:38 -04:00
|
|
|
end
|