Sha256: e67bd6b831e0616531364eb7612d257fc9d45ddcd9d2d2afe78e2ac9e55febed
Contents?: true
Size: 851 Bytes
Versions: 62
Compression:
Stored size: 851 Bytes
Contents
require 'test_helper' module Workarea module Admin module Dashboards class MarketingViewModelTest < TestCase def test_email_signups create_email_signup(created_at: Time.zone.local(2018, 12, 31)) create_email_signup(created_at: Time.zone.local(2019, 1, 3)) create_email_signup(created_at: Time.zone.local(2019, 1, 9)) create_email_signup(created_at: Time.zone.local(2019, 1, 10)) travel_to Time.zone.local(2019, 1, 10) view_model = MarketingViewModel.new assert_equal(2, view_model.email_signups) assert_equal(100, view_model.email_signups_percent_change) assert_equal( { Date.new(2019, 1, 3) => 1, Date.new(2019, 1, 9) => 1 }, view_model.email_signups_graph_data ) end end end end end
Version data entries
62 entries across 62 versions & 1 rubygems