FEATURE: new setting to disable ads based on category of current page
Use the "no ads for categories" setting to define which category pages (topic list and topics) should not render any ads.
This commit is contained in:
@@ -3,6 +3,7 @@ import { acceptance, replaceCurrentUser } from "helpers/qunit-helpers";
|
||||
acceptance("House Ads", {
|
||||
loggedIn: true,
|
||||
settings: {
|
||||
no_ads_for_categories: "1",
|
||||
house_ads_after_nth_post: 6
|
||||
},
|
||||
site: {
|
||||
@@ -66,4 +67,28 @@ test("correct ads show", async assert => {
|
||||
1,
|
||||
"it should render ad above topic list"
|
||||
);
|
||||
|
||||
await visit("/t/28830");
|
||||
assert.equal(
|
||||
find(".h-above-post-stream").length,
|
||||
0,
|
||||
"no ad above post stream because category is in no_ads_for_categories"
|
||||
);
|
||||
assert.equal(
|
||||
find(".h-post").length,
|
||||
0,
|
||||
"no ad between posts because category is in no_ads_for_categories"
|
||||
);
|
||||
assert.equal(
|
||||
find(".h-above-suggested").length,
|
||||
0,
|
||||
"no ad above suggested because category is in no_ads_for_categories"
|
||||
);
|
||||
|
||||
await visit("/c/bug");
|
||||
assert.equal(
|
||||
find(".h-topic-list").length,
|
||||
0,
|
||||
"no ad above category topic list because category is in no_ads_for_categories"
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user