-
Notifications
You must be signed in to change notification settings - Fork 2
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 'are you sure?' screen when paying by bank transfer #820
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
..._engine/bank_transfer_forms_controller.rb → ...confirm_bank_transfer_forms_controller.rb
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
4 changes: 1 addition & 3 deletions
4
...ste_carriers_engine/bank_transfer_form.rb → ...iers_engine/confirm_bank_transfer_form.rb
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
7 changes: 6 additions & 1 deletion
7
app/forms/waste_carriers_engine/copy_cards_bank_transfer_form.rb
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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
module WasteCarriersEngine | ||
class CopyCardsBankTransferForm < BankTransferForm | ||
class CopyCardsBankTransferForm < BaseForm | ||
delegate :total_to_pay, to: :transient_registration | ||
|
||
def self.can_navigate_flexibly? | ||
false | ||
end | ||
end | ||
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
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
85 changes: 0 additions & 85 deletions
85
app/views/waste_carriers_engine/bank_transfer_forms/new.html.erb
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
app/views/waste_carriers_engine/confirm_bank_transfer_forms/new.html.erb
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,24 @@ | ||
<%= render("waste_carriers_engine/shared/back", back_path: back_confirm_bank_transfer_forms_path(@confirm_bank_transfer_form.token)) %> | ||
|
||
<div class="text"> | ||
<%= form_for(@confirm_bank_transfer_form) do |f| %> | ||
<h1 class="heading-large"><%= t(".heading") %></h1> | ||
|
||
<p> | ||
<%= t(".paragraph_1") %> | ||
</p> | ||
|
||
<p> | ||
<%= t(".paragraph_2") %> | ||
</p> | ||
|
||
<p> | ||
<%= link_to(t(".link_text"), | ||
back_confirm_bank_transfer_forms_path(@confirm_bank_transfer_form.token)) %> | ||
</p> | ||
|
||
<div class="form-group"> | ||
<%= f.submit t(".next_button"), class: "button" %> | ||
</div> | ||
<% end %> | ||
</div> |
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
en: | ||
waste_carriers_engine: | ||
confirm_bank_transfer_forms: | ||
new: | ||
title: Pay by bank transfer | ||
heading: Registration takes longer if you pay by bank transfer | ||
paragraph_1: "In order to pay by bank transfer, you will need to follow the instructions on the next screen and email us to confirm payment. This will take approximately 5 working days." | ||
paragraph_2: "In most cases we can provide instant confirmation if you pay by card." | ||
link_text: "Go back to pay by credit or debit card instead" | ||
next_button: "Confirm you’ll pay by bank transfer" |
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
4 changes: 2 additions & 2 deletions
4
spec/factories/forms/bank_transfer_form.rb → ...ories/forms/confirm_bank_transfer_form.rb
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
FactoryBot.define do | ||
factory :bank_transfer_form, class: WasteCarriersEngine::BankTransferForm do | ||
factory :confirm_bank_transfer_form, class: WasteCarriersEngine::ConfirmBankTransferForm do | ||
trait :has_required_data do | ||
initialize_with { new(create(:renewing_registration, :has_required_data, workflow_state: "bank_transfer_form")) } | ||
initialize_with { new(create(:renewing_registration, :has_required_data, workflow_state: "confirm_bank_transfer_form")) } | ||
end | ||
end | ||
end |
29 changes: 0 additions & 29 deletions
29
spec/forms/waste_carriers_engine/bank_transfer_forms_spec.rb
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
spec/forms/waste_carriers_engine/confirm_bank_transfer_forms_spec.rb
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,29 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rails_helper" | ||
|
||
module WasteCarriersEngine | ||
RSpec.describe ConfirmBankTransferForm, type: :model do | ||
describe "#submit" do | ||
let(:confirm_bank_transfer_form) { build(:confirm_bank_transfer_form, :has_required_data) } | ||
|
||
context "when the form is valid" do | ||
let(:valid_params) { { token: confirm_bank_transfer_form.token } } | ||
|
||
it "should submit" do | ||
expect(confirm_bank_transfer_form.submit(valid_params)).to eq(true) | ||
end | ||
end | ||
|
||
context "when the form is not valid" do | ||
before do | ||
expect(confirm_bank_transfer_form).to receive(:valid?).and_return(false) | ||
end | ||
|
||
it "should not submit" do | ||
expect(confirm_bank_transfer_form.submit({})).to eq(false) | ||
end | ||
end | ||
end | ||
end | ||
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we changing this? I thought the scope of the ticket wasn't including copy cards flow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! Never mind. I got it :)