mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: better error message when invited user already exists
This commit is contained in:
@@ -152,11 +152,10 @@ describe Invite do
|
||||
context 'an existing user' do
|
||||
let(:topic) { Fabricate(:topic, category_id: nil, archetype: 'private_message') }
|
||||
let(:coding_horror) { Fabricate(:coding_horror) }
|
||||
let!(:invite) { topic.invite_by_email(topic.user, coding_horror.email) }
|
||||
|
||||
it "works" do
|
||||
# doesn't create an invite
|
||||
expect(invite).to be_blank
|
||||
expect { topic.invite_by_email(topic.user, coding_horror.email) }.to raise_error(StandardError)
|
||||
|
||||
# gives the user permission to access the topic
|
||||
expect(topic.allowed_users.include?(coding_horror)).to eq(true)
|
||||
|
||||
@@ -1773,8 +1773,7 @@ describe Topic do
|
||||
|
||||
it "should add user to the group" do
|
||||
expect(Guardian.new(walter).can_see?(group_private_topic)).to be_falsey
|
||||
invite = group_private_topic.invite(group_manager, walter.email)
|
||||
expect(invite).to be_nil
|
||||
expect { group_private_topic.invite(group_manager, walter.email) }.to raise_error(StandardError)
|
||||
expect(walter.groups).to include(group)
|
||||
expect(Guardian.new(walter).can_see?(group_private_topic)).to be_truthy
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user