Split alias levels in mentionable and messageable levels. (#5065)

* Split alias levels in mentionable and messageable levels.

* Fixed some tests.

* Set messageable level to everyone by default.

* By defaults, groups are not mentionable or messageable.

* Made staff groups messageable by the system.
This commit is contained in:
Bianca Nenciu
2017-08-28 17:32:08 +01:00
committed by Sam
parent ce2250d7aa
commit 6bc74ceb50
20 changed files with 81 additions and 32 deletions

View File

@ -755,7 +755,7 @@ describe PostsController do
it "can send a message to a group" do
group = Group.create(name: 'test_group', alias_level: Group::ALIAS_LEVELS[:nobody])
group = Group.create(name: 'test_group', messageable_level: Group::ALIAS_LEVELS[:nobody])
user1 = Fabricate(:user)
group.add(user1)
@ -767,7 +767,7 @@ describe PostsController do
expect(response).not_to be_success
# allow pm to this group
group.update_columns(alias_level: Group::ALIAS_LEVELS[:everyone])
group.update_columns(messageable_level: Group::ALIAS_LEVELS[:everyone])
xhr :post, :create, raw: 'I can haz a test',
title: 'I loves my test',