Add postponed and closed flags to Pinned and Notification cards
This commit is contained in:
@@ -8,6 +8,7 @@ json.cache! card do
|
||||
json.tags card.tags.pluck(:title).sort
|
||||
|
||||
json.closed card.closed?
|
||||
json.postponed card.postponed?
|
||||
json.golden card.golden?
|
||||
json.last_active_at card.last_active_at.utc
|
||||
json.created_at card.created_at.utc
|
||||
|
||||
@@ -12,6 +12,8 @@ json.cache! notification do
|
||||
json.card do
|
||||
json.(notification.card, :id, :number, :title, :status)
|
||||
json.board_name notification.card.board.name
|
||||
json.closed notification.card.closed?
|
||||
json.postponed notification.card.postponed?
|
||||
json.url card_url(notification.card)
|
||||
json.column notification.card.column, partial: "columns/column", as: :column if notification.card.column
|
||||
end
|
||||
|
||||
@@ -171,6 +171,7 @@ class CardsControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
assert_equal card.title, @response.parsed_body["title"]
|
||||
assert_equal card.closed?, @response.parsed_body["closed"]
|
||||
assert_equal card.postponed?, @response.parsed_body["postponed"]
|
||||
assert_equal 2, @response.parsed_body["steps"].size
|
||||
assert_equal card_comments_url(card), @response.parsed_body["comments_url"]
|
||||
assert_equal card_reactions_url(card), @response.parsed_body["reactions_url"]
|
||||
|
||||
@@ -26,5 +26,9 @@ class NotificationsControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_not_nil notification.dig("card", "number")
|
||||
assert_not_nil notification.dig("card", "board_name")
|
||||
assert_not_nil notification.dig("card", "column")
|
||||
|
||||
card = notifications(:logo_assignment_kevin).card
|
||||
assert_equal card.closed?, notification.dig("card", "closed")
|
||||
assert_equal card.postponed?, notification.dig("card", "postponed")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user