Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: admin mailer view format + update tests #803

Merged
merged 2 commits into from
Nov 30, 2023

Conversation

yulia-bel
Copy link
Contributor

Fix for previous admin notifications for new accounts creation:

  • Mailer view for new project developer notification renamed to have correct format
  • admin_mailer_spec.rb extended to cover project_developer_created and investor_created mailer views

Testing instructions

admin_mailer_spec.rb extended to cover project_developer_created and investor_created mailer views

Tracking

Link to the task(s), if any

@yulia-bel yulia-bel force-pushed the fix/backend-admin-mailer-new-accounts branch from e9b5fee to 903efe0 Compare November 29, 2023 14:59
Copy link
Contributor

@agnessa agnessa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏


it "renders the body" do
expect(mail.body.encoded).to match(I18n.t("admin_mailer.greetings", full_name: admin.full_name))
expect(mail.body.encoded).to match(I18n.t("admin_mailer.project_developer_created.content_html", new_pd_url: ""))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend to test also whole url inside mailer and not just new_pd_url: "". You should be able to use here link_to('New Investor', backoffice_investor_url(investor)) -- only part which is missing to make this work is I think url helper (backoffice_investor_url) which is added automatically to request tests here: https://github.com/Vizzuality/heco-invest/blob/develop/backend/spec/rails_helper.rb#L41. You can modify this line and add these helpers also to mailer tests which should give you all methods you need.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! seems like adding helpers directly to tests have worked

@yulia-bel yulia-bel merged commit 1bb5994 into develop Nov 30, 2023
3 checks passed
@yulia-bel yulia-bel deleted the fix/backend-admin-mailer-new-accounts branch November 30, 2023 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants