Skip to content

Commit

Permalink
Add slack link to confirmation email (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
gamesover authored Jan 15, 2025
1 parent 5ebbbfe commit 439a109
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/views/devise/mailer/confirmation_instructions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ Confirm your membership with Ruby Australia.
<p>To confirm both your email address and your membership for Ruby Australia, please follow the link below:</p>

<p class="button"><%= link_to 'Confirm my membership', confirmation_url(@resource, confirmation_token: @token) %></p>

<p>Once you've completed the confirmation above, be sure to join our Slack community at <%= link_to 'Slack', slack_url %>.</p>
6 changes: 4 additions & 2 deletions spec/features/committee_manages_members_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@
expect(page).to have_content("Alex")
expect(page).to have_content("Not yet")

last_year = Time.zone.today.year - 1

click_link "Edit"
select "2019", from: "access_request_viewed_on_1i"
select last_year.to_s, from: "access_request_viewed_on_1i"
select "December", from: "access_request_viewed_on_2i"
select "31", from: "access_request_viewed_on_3i"
click_button "Save"

expect(page).to have_content("Alex")
expect(page).to have_content("2019-12-31")
expect(page).to have_content("#{last_year}-12-31")
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
require 'rails_helper'

RSpec.describe "devise/mailer/confirmation_instructions.html.erb", type: :view do
include Rails.application.routes.url_helpers

let(:user) { create(:user, full_name: "John Doe") }
let(:token) { "fake_token" }

before do
assign(:resource, user)
assign(:token, token)

render
end

it "displays the preheader text" do
expect(rendered).to include("Confirm my membership")
end

it "displays the welcome message with the user's full name" do
expect(rendered).to match(/Welcome John Doe!/)
end

it "displays the confirmation instructions" do
expect(rendered).to match(/To confirm both your email address and your membership for Ruby Australia, please follow the link below:/)
end

it "displays the confirmation link" do
expect(rendered).to have_link('Confirm my membership', href: user_confirmation_url(confirmation_token: token))
end

it "displays the Slack community invitation" do
expect(rendered).to have_link('Slack', href: slack_url)
end
end

0 comments on commit 439a109

Please sign in to comment.