File tree Expand file tree Collapse file tree 4 files changed +21
-10
lines changed
Expand file tree Collapse file tree 4 files changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ def episode_explicit_options
1616 end
1717
1818 def episode_integration_status ( integration , episode )
19+ return "draft" if episode . draft?
1920 return "not_publishable" unless episode . integration_feed_episode? ( integration )
2021
2122 status = episode . episode_delivery_status ( integration , true )
Original file line number Diff line number Diff line change 4141 < div class ="col-12 mt-4 ">
4242 < p class ="status-text ">
4343 < strong > <%= integration . to_s . titleize %> Status:</ strong >
44- < span class ="badge rounded-pill prx-badge- <%= integration_status %> ">
45- <%= t ( "helpers.label.episode.media_statuses.#{ integration_status } " ) %>
46- </ span >
47- < br >
48- < strong > <%= integration . to_s . titleize %> <%= t ( ".last_updated" ) %> </ strong >
49- < br >
50- <%= local_time_ago ( episode_integration_updated_at ( integration , episode ) ) %>
44+ <% unless integration_status == "draft" %>
45+ < span class ="badge rounded-pill prx-badge- <%= integration_status %> ">
46+ <%= t ( "helpers.label.episode.media_statuses.#{ integration_status } " ) %>
47+ </ span >
48+ < br >
49+ < strong > <%= integration . to_s . titleize %> <%= t ( ".last_updated" ) %> </ strong >
50+ < br >
51+ <%= local_time_ago ( episode_integration_updated_at ( integration , episode ) ) %>
52+ <% end %>
5153 </ p >
5254 </ div >
5355 <% end %>
Original file line number Diff line number Diff line change 4747 </ li >
4848 < li class ="list-group-item d-flex justify-content-between align-items-center ">
4949 < span > <%= t ( ".apple" ) %> </ span >
50- < span class ="badge rounded-pill prx-badge- <%= episode_integration_status ( :apple , episode ) %> ">
51- <%= t ( "helpers.label.episode.media_statuses.#{ episode_integration_status ( :apple , episode ) } " ) %>
52- </ span >
50+ <% unless episode_integration_status ( :apple , episode ) == "draft" %>
51+ < span class ="badge rounded-pill prx-badge- <%= episode_integration_status ( :apple , episode ) %> ">
52+ <%= t ( "helpers.label.episode.media_statuses.#{ episode_integration_status ( :apple , episode ) } " ) %>
53+ </ span >
54+ <% end %>
5355 </ li >
5456 < li class ="list-group-item "> <%= t ( ".spotify" ) %> </ li >
5557 </ ul >
Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ class TestHelper
99 let ( :podcast ) { create ( :podcast ) }
1010
1111 describe "#episode_integration_status" do
12+ it "returns 'draft' when episode is a draft" do
13+ draft_episode = create ( :episode , podcast : podcast , published_at : nil )
14+ assert_equal "draft" , helper . episode_integration_status ( :apple , draft_episode )
15+ assert_equal "draft" , helper . episode_integration_status ( :megaphone , draft_episode )
16+ end
17+
1218 it "returns 'not_publishable' when episode does not publish to the integration" do
1319 episode = create ( :episode , podcast : podcast , published_at : 1 . hour . ago )
1420 assert_equal "not_publishable" , helper . episode_integration_status ( :apple , episode )
You can’t perform that action at this time.
0 commit comments