|
|
@ -7,13 +7,13 @@ RSpec.describe "User Features" do |
|
|
|
let(:org_id) { organisation.id } |
|
|
|
let(:org_id) { organisation.id } |
|
|
|
let(:set_password_template_id) { User::CONFIRMABLE_TEMPLATE_ID } |
|
|
|
let(:set_password_template_id) { User::CONFIRMABLE_TEMPLATE_ID } |
|
|
|
let(:notify_client) { instance_double(Notifications::Client) } |
|
|
|
let(:notify_client) { instance_double(Notifications::Client) } |
|
|
|
let(:reset_password_token) { "MCDH5y6Km-U7CFPgAMVS" } |
|
|
|
let(:confirmation_token) { "MCDH5y6Km-U7CFPgAMVS" } |
|
|
|
let(:devise_notify_mailer) { DeviseNotifyMailer.new } |
|
|
|
let(:devise_notify_mailer) { DeviseNotifyMailer.new } |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
|
allow(DeviseNotifyMailer).to receive(:new).and_return(devise_notify_mailer) |
|
|
|
allow(DeviseNotifyMailer).to receive(:new).and_return(devise_notify_mailer) |
|
|
|
allow(devise_notify_mailer).to receive(:notify_client).and_return(notify_client) |
|
|
|
allow(devise_notify_mailer).to receive(:notify_client).and_return(notify_client) |
|
|
|
allow(Devise.token_generator).to receive(:generate).and_return(reset_password_token) |
|
|
|
allow(Devise.token_generator).to receive(:generate).and_return(confirmation_token) |
|
|
|
allow(notify_client).to receive(:send_email).and_return(true) |
|
|
|
allow(notify_client).to receive(:send_email).and_return(true) |
|
|
|
sign_in user |
|
|
|
sign_in user |
|
|
|
end |
|
|
|
end |
|
|
@ -55,7 +55,7 @@ RSpec.describe "User Features" do |
|
|
|
name: "New User", |
|
|
|
name: "New User", |
|
|
|
email: "new_user@example.com", |
|
|
|
email: "new_user@example.com", |
|
|
|
organisation: organisation.name, |
|
|
|
organisation: organisation.name, |
|
|
|
link: "http://localhost:3000/account/password/edit?reset_password_token=#{reset_password_token}", |
|
|
|
link: "http://localhost:3000/account/confirmation?confirmation_token=#{confirmation_token}", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
) |
|
|
|
) |
|
|
|