FEATURE: new 'block_auto_generated_emails' site setting

This commit is contained in:
Régis Hanol
2016-04-20 21:29:27 +02:00
parent f62ffce03b
commit 4960b62110
16 changed files with 81 additions and 23 deletions
@@ -19,18 +19,18 @@ postStreamTest('basics', {
const site = this.container.lookup('site:main');
const topic = Topic.create({ details: { created_by: { id: 123 } } });
return [
Post.create({ topic, id: 1, post_number: 1, user_id: 123, primary_group_name: 'trout',
avatar_template: '/images/avatar.png' }),
Post.create({ topic, id: 1, post_number: 1, user_id: 123, primary_group_name: 'trout', avatar_template: '/images/avatar.png' }),
Post.create({ topic, id: 2, post_number: 2, post_type: site.get('post_types.moderator_action') }),
Post.create({ topic, id: 3, post_number: 3, hidden: true }),
Post.create({ topic, id: 4, post_number: 4, post_type: site.get('post_types.whisper') }),
Post.create({ topic, id: 5, post_number: 5, wiki: true, via_email: true })
Post.create({ topic, id: 5, post_number: 5, wiki: true, via_email: true }),
Post.create({ topic, id: 6, post_number: 6, via_email: true, is_auto_generated: true }),
];
},
test(assert) {
assert.equal(this.$('.post-stream').length, 1);
assert.equal(this.$('.topic-post').length, 5, 'renders all posts');
assert.equal(this.$('.topic-post').length, 6, 'renders all posts');
// look for special class bindings
assert.equal(this.$('.topic-post:eq(0).topic-owner').length, 1, 'it applies the topic owner class');
@@ -46,6 +46,7 @@ postStreamTest('basics', {
assert.equal(this.$('article[data-user-id=123]').length, 1);
assert.equal(this.$('article[data-post-id=3]').length, 1);
assert.equal(this.$('article#post_5.via-email').length, 1);
assert.equal(this.$('article#post_6.is-auto-generated').length, 1);
assert.equal(this.$('article:eq(0) .main-avatar').length, 1, 'renders the main avatar');
}