mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:21:18 +08:00
Backend support for group invites
This commit is contained in:
@ -299,11 +299,6 @@ describe Topic do
|
||||
|
||||
context 'invite' do
|
||||
|
||||
it "delegates to topic.invite_by_email when the user doesn't exist, but it's an email" do
|
||||
topic.expects(:invite_by_email).with(topic.user, 'jake@adventuretime.ooo')
|
||||
topic.invite(topic.user, 'jake@adventuretime.ooo')
|
||||
end
|
||||
|
||||
context 'existing user' do
|
||||
let(:walter) { Fabricate(:walter_white) }
|
||||
|
||||
@ -324,19 +319,14 @@ describe Topic do
|
||||
end
|
||||
|
||||
context 'by email' do
|
||||
it 'returns true' do
|
||||
topic.invite(topic.user, walter.email).should be_true
|
||||
end
|
||||
|
||||
it 'adds walter to the allowed users' do
|
||||
topic.invite(topic.user, walter.email)
|
||||
it 'adds user correctly' do
|
||||
lambda {
|
||||
topic.invite(topic.user, walter.email).should be_true
|
||||
}.should change(Notification, :count)
|
||||
topic.allowed_users.include?(walter).should be_true
|
||||
end
|
||||
|
||||
it 'creates a notification' do
|
||||
lambda { topic.invite(topic.user, walter.email) }.should change(Notification, :count)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user