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.
7 lines
285 B
Ruby
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
|