UX: Wizard resends activation email when user exists

This commit is contained in:
Gerhard Schlager
2018-08-21 19:13:41 +02:00
parent d1607a387a
commit 17dc8f2490
2 changed files with 46 additions and 15 deletions
@@ -68,18 +68,40 @@ describe FinishInstallationController do
expect(response).not_to be_redirect
end
it "registers the admin when the email is in the list" do
expect do
post "/finish-installation/register.json", params: {
context "working params" do
let(:params) do
{
email: 'robin@example.com',
username: 'eviltrout',
password: 'disismypasswordokay'
}
end.to change { Jobs::CriticalUserEmail.jobs.size }.by(1)
end
expect(response).to be_redirect
expect(User.where(username: 'eviltrout').exists?).to eq(true)
it "registers the admin when the email is in the list" do
expect do
post "/finish-installation/register.json", params: params
end.to change { Jobs::CriticalUserEmail.jobs.size }.by(1)
expect(response).to be_redirect
expect(User.where(username: 'eviltrout').exists?).to eq(true)
end
it "automatically resends the signup email when the user already exists" do
expect do
post "/finish-installation/register.json", params: params
end.to change { Jobs::CriticalUserEmail.jobs.size }.by(1)
expect(User.where(username: 'eviltrout').exists?).to eq(true)
expect do
post "/finish-installation/register.json", params: params
end.to change { Jobs::CriticalUserEmail.jobs.size }.by(1)
expect(response).to be_redirect
expect(User.where(username: 'eviltrout').exists?).to eq(true)
end
end
end
end