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

Add slack link to confirmation email #270

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is too old. min year is 5 years ago which is 2000

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
Loading