invite: add button for invite someone to collaborate on a draft

This commit is contained in:
Pierre de La Morinerie 2018-08-01 17:27:50 +02:00 committed by gregoirenovel
parent 9541e781bb
commit 1cac0b80af
10 changed files with 239 additions and 6 deletions

View file

@ -69,11 +69,16 @@ describe InvitesController, type: :controller do
context 'when user has access to dossier' do
before do
request.env["HTTP_REFERER"] = "/dossiers/#{dossier.id}/modifier"
dossier.update(user: signed_in_profile)
end
it { expect { subject }.to change(InviteUser, :count).by(1) }
it "redirects to the previous URL" do
expect(subject).to redirect_to("/dossiers/#{dossier.id}/modifier")
end
context 'when email is assign to an user' do
let! (:user_invite) { create(:user, email: email) }