FIX: Calculate no ads for groups server side (#200)
If the selected group to not display ads to had its visibility set to not be visible then this setting wouldn't work correctly because that group wouldn't be available client side. The change moves that group check to be server side so that we can correctly see all the groups that should not see ads.
This commit is contained in:
@@ -48,6 +48,7 @@ acceptance("AdSense", function (needs) {
|
||||
trust_level: 1,
|
||||
groups: [AUTO_GROUPS.trust_level_1],
|
||||
show_adsense_ads: true,
|
||||
show_to_groups: true,
|
||||
});
|
||||
await visit("/t/280"); // 20 posts
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ acceptance("DFP Ads", function (needs) {
|
||||
staff: false,
|
||||
trust_level: 1,
|
||||
show_dfp_ads: true,
|
||||
show_to_groups: true,
|
||||
});
|
||||
await visit("/t/280"); // 20 posts
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ acceptance("House Ads", function (needs) {
|
||||
});
|
||||
|
||||
test("correct ads show", async (assert) => {
|
||||
updateCurrentUser({ staff: false, trust_level: 1 });
|
||||
updateCurrentUser({ staff: false, trust_level: 1, show_to_groups: true });
|
||||
await visit("/t/280"); // 20 posts
|
||||
|
||||
assert
|
||||
|
||||
@@ -49,6 +49,7 @@ acceptance("Mixed Ads", function (needs) {
|
||||
staff: false,
|
||||
trust_level: 1,
|
||||
show_dfp_ads: true,
|
||||
show_to_groups: true,
|
||||
});
|
||||
await visit("/t/280"); // 20 posts
|
||||
|
||||
|
||||
Reference in New Issue
Block a user