-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add activate your account step 2 page
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<%# TODO: This page needs a proper design %> | ||
<%# TODO: Extract out component for this centred block %> | ||
<div class="max-w-lg mx-auto"> | ||
<%# This is using a different style than the standard Heading component %> | ||
<%= render Tailwind::Heading.new(tag: :h1, color: "fuchsia", extra_classes: "my-20 text-center").with_content("Activate your account") %> | ||
|
||
<%= form_with model: @user, url: users_activation_path, method: :put, builder: FormBuilders::Tailwind do |f| %> | ||
<%= f.hidden_field :reset_password_token %> | ||
|
||
<div class="flex flex-col items-center"> | ||
<div class="w-full"> | ||
<%= f.label :name, "Your full name", class: "block" %> | ||
<%= f.text_field :name, class: "mt-1 block w-full", autofocus: true, autocomplete: "name", placeholder: "e.g. Jane Citizen" %> | ||
<%= f.error :name, class: "mt-2" %> | ||
</div> | ||
|
||
<div class="w-full mt-5"> | ||
<%= f.label :password, "Password", class: "block" %> | ||
<%= f.password_field :password, class: "mt-1 block w-full", autocomplete: "new-password" %> | ||
<%= f.error :password, class: "mt-2" %> | ||
<% if @minimum_password_length %> | ||
<p class="mt-2 text-2xl font-light text-navy"><%= @minimum_password_length %> characters minimum</p> | ||
<% end %> | ||
</div> | ||
|
||
<div class="mt-8"> | ||
<%= f.button "Activate my account" %> | ||
</div> | ||
</div> | ||
<% end %> | ||
<div class="mt-10 text-2xl text-navy"> | ||
<%= render "privacy_policy" %> | ||
</div> | ||
</div> | ||
|
||
<% | ||
=begin | ||
%> | ||
<p class="login-explanation"> | ||
After you have activated your account you will be able to login using your | ||
email and password. | ||
</p> | ||
<% | ||
=end | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,23 @@ | |
# rubocop:enable RSpec/NoExpectationExample | ||
end | ||
|
||
context "when on final activate your account page in the new design" do | ||
before do | ||
# Do this weird dance to get us on to the new theme | ||
sign_in create(:confirmed_user, tailwind_theme: true) | ||
visit root_path | ||
sign_out :user | ||
# Strictly this page needs a token to function but for the purposes of this we don't need to do that | ||
visit edit_users_activation_path | ||
end | ||
|
||
# rubocop:disable RSpec/NoExpectationExample | ||
it "renders the page", js: true do | ||
page.percy_snapshot("Activate step 2") | ||
end | ||
# rubocop:enable RSpec/NoExpectationExample | ||
end | ||
|
||
context "with a confirmed user that has not been activated" do | ||
before do | ||
u = User.new(email: "[email protected]", from_alert_or_comment: true, confirmed_at: Time.zone.now) | ||
|