docbrown/spec/models/display_ad_event_spec.rb
Jeremy Friesen b56ae3acbb
Extracting constants and tidying tests (#15946)
Prior to this commit, we had a couple of references to magic strings
regarding DisplayAdEvent objects.  This commit seeks to consolidate that
behavior.

In a handful of cases we had javascript variables, but as these JS files
are `erb` templates, we can inject the constant as well.  This reduces
repetition of knowledge.
2022-01-05 09:19:39 -05:00

7 lines
285 B
Ruby

require "rails_helper"
RSpec.describe DisplayAdEvent, type: :model do
it { is_expected.to validate_inclusion_of(:category).in_array(described_class::VALID_CATEGORIES) }
it { is_expected.to validate_inclusion_of(:context_type).in_array(described_class::VALID_CONTEXT_TYPES) }
end