瀏覽代碼

Remove redundant code in AtomSerializer and spec (#3528)

* Remove redundant status.reply? in AtomSerializer#object

* Cover AtomSerializer more
master
Akihiko Odaki (@fn_aki@pawoo.net) 7 年之前
committed by Eugen Rochko
父節點
當前提交
ce7c0def88
共有 3 個文件被更改,包括 1479 次插入130 次删除
  1. +1
    -1
      app/lib/atom_serializer.rb
  2. +1
    -1
      spec/fabricators/follow_request_fabricator.rb
  3. +1477
    -128
      spec/lib/atom_serializer_spec.rb

+ 1
- 1
app/lib/atom_serializer.rb 查看文件

@@ -107,7 +107,7 @@ class AtomSerializer
serialize_status_attributes(object, status) serialize_status_attributes(object, status)


append_element(object, 'link', nil, rel: :alternate, type: 'text/html', href: TagManager.instance.url_for(status)) append_element(object, 'link', nil, rel: :alternate, type: 'text/html', href: TagManager.instance.url_for(status))
append_element(object, 'thr:in-reply-to', nil, ref: TagManager.instance.uri_for(status.thread), href: TagManager.instance.url_for(status.thread)) if status.reply? && !status.thread.nil?
append_element(object, 'thr:in-reply-to', nil, ref: TagManager.instance.uri_for(status.thread), href: TagManager.instance.url_for(status.thread)) unless status.thread.nil?
append_element(object, 'ostatus:conversation', nil, ref: conversation_uri(status.conversation)) unless status.conversation_id.nil? append_element(object, 'ostatus:conversation', nil, ref: conversation_uri(status.conversation)) unless status.conversation_id.nil?


object object


+ 1
- 1
spec/fabricators/follow_request_fabricator.rb 查看文件

@@ -1,4 +1,4 @@
Fabricator(:follow_request) do Fabricator(:follow_request) do
account account
target_account { Fabricate(:account) }
target_account { Fabricate(:account, locked: true) }
end end

+ 1477
- 128
spec/lib/atom_serializer_spec.rb
文件差異過大導致無法顯示
查看文件


Loading…
取消
儲存