mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 03:10:46 -06:00
add failing test for AMS upgrade
This commit is contained in:
parent
da62a10b77
commit
370e961a90
19
spec/serializers/topic_list_item_serializer_spec.rb
Normal file
19
spec/serializers/topic_list_item_serializer_spec.rb
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
require_dependency 'post_action'
|
||||||
|
|
||||||
|
describe TopicListItemSerializer do
|
||||||
|
|
||||||
|
it "correctly serializes topic" do
|
||||||
|
date = Time.zone.now
|
||||||
|
|
||||||
|
topic = Topic.new
|
||||||
|
topic.title = "test"
|
||||||
|
topic.created_at = date - 2.minutes
|
||||||
|
topic.bumped_at = date
|
||||||
|
topic.posters = []
|
||||||
|
serialized = TopicListItemSerializer.new(topic, scope: Guardian.new, root: false).as_json
|
||||||
|
|
||||||
|
serialized[:title].should == "test"
|
||||||
|
serialized[:bumped].should == true
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user