-
Notifications
You must be signed in to change notification settings - Fork 0
[WRSAT-177] create reminders email screen #66
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6b377d0
things are broken and i don't know why
anisharamnani 5f4f2a6
WRSAT-177 add email reminder page
anisharamnani d5cf261
uncomment personal info page
anisharamnani 3fb9aac
address PR comments
anisharamnani 01451ba
lint
anisharamnani 28a000a
Merge remote-tracking branch 'origin/main' into WRSAT-177-create-remi…
anisharamnani 7a9914b
fix locales and schema
anisharamnani 637c07c
lint
anisharamnani 14618df
Merge remote-tracking branch 'origin/main' into WRSAT-177-create-remi…
anisharamnani c673e41
lint
anisharamnani b0c0a77
strip email and the confirmation of white space
anisharamnani 4800885
change method name
anisharamnani 10adc7f
Merge remote-tracking branch 'origin/main' into WRSAT-177-create-remi…
anisharamnani 155be03
add additional tests
anisharamnani ee3299c
lint
anisharamnani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,7 @@ | ||
| class EmailController < QuestionController | ||
| include BasicInfoConcern | ||
|
|
||
| def self.attributes_edited | ||
| [:email, :email_confirmation] | ||
| end | ||
| end | ||
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| class TempEndController < QuestionController | ||
| layout "application" | ||
| def show_progress_bar | ||
| false | ||
| end | ||
|
|
||
This file contains hidden or 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
This file contains hidden or 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,11 @@ | ||
| <% content_for :question_title, t("views.email.edit.title") %> | ||
|
|
||
| <h1 class="h2"><%= content_for(:question_title) %></h1> | ||
|
|
||
| <p><%= t("views.email.edit.title_help_text") %></p> | ||
|
|
||
| <%= form_with model: @model, url: { action: :update }, data: { turbo: false }, local: true, method: "put", builder: Cfa::Styleguide::CfaFormBuilder do |f| %> | ||
| <%= f.cfa_input_field(:email, t("views.email.edit.email")) %> | ||
| <%= f.cfa_input_field(:email_confirmation, t("views.email.edit.email_confirmation")) %> | ||
| <%= f.submit t("general.continue"), class: "button button--primary" %> | ||
| <% end %> |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,25 +1,36 @@ | ||
| <div> | ||
| <h2>End of example</h2> | ||
| <br/> | ||
| <table> | ||
| <tr style="font-weight: bold; border-bottom: 1px solid #ddd;"> | ||
| <th style="padding-right: 15px;">screener id</th> | ||
| <th style="padding-right: 15px;">written language</th> | ||
| <th style="padding-right: 15px;">spoken language</th> | ||
| <th style="padding-right: 15px;">is_receiving_snap_benefits</th> | ||
| </tr> | ||
| <% Screener.all.each do |screener| %> | ||
| <tr style="border-bottom: 1px solid #ddd;"> | ||
| <td><%= screener.id %></td> | ||
| <td><%= screener.language_preference_written %></td> | ||
| <td><%= screener.language_preference_spoken %></td> | ||
| <td><%= screener.first_name %></td> | ||
| <td><%= screener.middle_name %></td> | ||
| <td><%= screener.last_name %></td> | ||
| <td><%= screener.birth_date %></td> | ||
| <td><%= screener.phone_number %></td> | ||
| <td><%= screener.is_receiving_snap_benefits_yes? %></td> | ||
| </tr> | ||
| <% end %> | ||
| </table> | ||
| </div> | ||
| <section class="slab"> | ||
| <div class="grid"> | ||
| <div class="grid__item width-one-whole"> | ||
| <h2>End of example</h2> | ||
| <br/> | ||
| <table style="display: block;overflow-x: auto;white-space: nowrap;"> | ||
| <tr style="font-weight: bold; border-bottom: 1px solid #ddd;"> | ||
| <th style="padding-right: 15px;">screener id</th> | ||
| <th style="padding-right: 15px;">written language</th> | ||
| <th style="padding-right: 15px;">spoken language</th> | ||
| <th style="padding-right: 15px;">first_name</th> | ||
| <th style="padding-right: 15px;">middle_name</th> | ||
| <th style="padding-right: 15px;">last_name</th> | ||
| <th style="padding-right: 15px;">birth_date</th> | ||
| <th style="padding-right: 15px;">phone_number</th> | ||
| <th style="padding-right: 15px;">is_receiving_snap_benefits</th> | ||
| <th style="padding-right: 15px;">email</th> | ||
| </tr> | ||
| <% Screener.all.each do |screener| %> | ||
| <tr style="border-bottom: 1px solid #ddd;"> | ||
| <td><%= screener.id %></td> | ||
| <td><%= screener.language_preference_written %></td> | ||
| <td><%= screener.language_preference_spoken %></td> | ||
| <td><%= screener.first_name %></td> | ||
| <td><%= screener.middle_name %></td> | ||
| <td><%= screener.last_name %></td> | ||
| <td><%= screener.birth_date %></td> | ||
| <td><%= screener.phone_number %></td> | ||
| <td><%= screener.is_receiving_snap_benefits_yes? %></td> | ||
| <td><%= screener.email %></td> | ||
| </tr> | ||
| <% end %> | ||
| </table> | ||
| </div> | ||
| </div> | ||
| </section> |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,5 @@ | ||
| class AddEmailToScreener < ActiveRecord::Migration[8.1] | ||
| def change | ||
| add_column :screeners, :email, :string | ||
| end | ||
| end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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,18 @@ | ||
| require "rails_helper" | ||
|
|
||
| RSpec.describe EmailController, type: :controller do | ||
| describe "#update" do | ||
| it "saves the email regardless of white spaces or capitalization" do | ||
| screener = create(:screener) | ||
|
|
||
| params = { | ||
| email: "[email protected] ", | ||
| email_confirmation: " [email protected]" | ||
| } | ||
|
|
||
| post :update, params: {screener: params} | ||
| expect(response).to redirect_to subject.next_path | ||
| expect(screener.reload.email).to eq "[email protected]" | ||
| end | ||
| end | ||
| end |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -50,6 +50,11 @@ | |
| fill_in I18n.t("views.personal_information.edit.phone_number_label"), with: "415-816-1286" | ||
| click_on I18n.t("general.continue") | ||
|
|
||
| expect(page).to have_selector("h1", text: I18n.t("views.email.edit.title")) | ||
| fill_in I18n.t("views.email.edit.email"), with: "[email protected]" | ||
| fill_in I18n.t("views.email.edit.email_confirmation"), with: "[email protected]" | ||
| click_on I18n.t("general.continue") | ||
|
|
||
| expect(page).to have_selector("h2", text: "End of example") | ||
| end | ||
| end | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -148,5 +148,28 @@ | |
|
|
||
| expect(screener.reload.pregnancy_due_date).to be_nil | ||
| end | ||
|
|
||
| context "with_context :email" do | ||
| it "requires a valid email" do | ||
| screener = Screener.new(email: "hi.gmail", email_confirmation: "hi.gmail") | ||
| screener.valid?(:email) | ||
|
|
||
| expect(screener.errors).to match_array ["Email is invalid"] | ||
| end | ||
|
|
||
| it "requires a confirmed email" do | ||
| screener = Screener.new(email: "[email protected]", email_confirmation: "[email protected]") | ||
| screener.valid?(:email) | ||
|
|
||
| expect(screener.errors).to match_array ["Email confirmation doesn't match Email"] | ||
| end | ||
|
|
||
| it "removed white spaces from the email and confirmation" do | ||
| screener = Screener.new(email: "[email protected] ", email_confirmation: " [email protected]") | ||
| screener.valid?(:email) | ||
|
|
||
| expect(screener.errors).to match_array [] | ||
| end | ||
| end | ||
| end | ||
| end | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.