diff --git a/app/presenters/content_items_csv_presenter.rb b/app/presenters/content_items_csv_presenter.rb index 800161937..172d4397f 100644 --- a/app/presenters/content_items_csv_presenter.rb +++ b/app/presenters/content_items_csv_presenter.rb @@ -51,6 +51,8 @@ def csv_rows end, I18n.t("metrics.words.short_title") => raw_field(:word_count), I18n.t("metrics.pdf_count.short_title") => raw_field(:pdf_count), + I18n.t("metrics.email_subscriptions.active_title") => raw_field(:subscriber_list_count), + I18n.t("metrics.email_subscriptions.total_notify_title") => raw_field(:all_notify_count), } CSV.generate do |csv| diff --git a/spec/presenters/content_items_csv_presenter_spec.rb b/spec/presenters/content_items_csv_presenter_spec.rb index 0f06af32e..3ca3a1fe9 100644 --- a/spec/presenters/content_items_csv_presenter_spec.rb +++ b/spec/presenters/content_items_csv_presenter_spec.rb @@ -37,6 +37,8 @@ word_count: 50, reading_time: 50, pdf_count: 0, + subscriber_list_count: 10, + all_notify_count: 300, }, { title: "Title 1", @@ -53,6 +55,8 @@ word_count: 100, reading_time: 100, pdf_count: 3, + subscriber_list_count: 0, + all_notify_count: 123, }, ] end @@ -92,6 +96,8 @@ I18n.t("metrics.reading_time.short_title"), I18n.t("metrics.words.short_title"), I18n.t("metrics.pdf_count.short_title"), + I18n.t("metrics.email_subscriptions.active_title"), + I18n.t("metrics.email_subscriptions.total_notify_title"), ] expected_headers.each do |header_name| @@ -177,6 +183,14 @@ it "has pdf count" do expect(subject[17]).to eq("0") end + + it "has email subscriber list count" do + expect(subject[18]).to eq("10") + end + + it "has email all notify count" do + expect(subject[19]).to eq("300") + end end end