Skip to content

Commit 78fc2ed

Browse files
committed
Merge pull request ruby-china#268 from bachue/fix-267
修复消息中心返回的数据没有topic_id的问题, fixes ruby-china#267
2 parents fc48162 + 77e1bb5 commit 78fc2ed

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app/grape/entities.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class DetailUser < Grape::Entity
4040
end
4141

4242
class Reply < Grape::Entity
43-
expose :id, :body, :body_html, :created_at, :updated_at, :deleted_at
43+
expose :id, :body, :body_html, :created_at, :updated_at, :deleted_at, :topic_id
4444
expose :user, :using => APIEntities::User
4545
end
4646

spec/api/notifications_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
json = JSON.parse(response.body)
2828
json[0]["read"].should be_false
2929
json[0]["mention"]["body"].should == "Test to mention user"
30+
json[0]["mention"]["topic_id"].should == topic.id
3031
json[0]["mention"]["user"]["login"].should == user.login
3132
end
3233

@@ -39,6 +40,7 @@
3940
json = JSON.parse(response.body)
4041
json[0]["read"].should be_false
4142
json[0]["reply"]["body"].should == "Test to reply user"
43+
json[0]["reply"]["topic_id"].should == topic.id
4244
json[0]["reply"]["user"]["login"].should == user.login
4345
end
4446

0 commit comments

Comments
 (0)