-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The reminders forms work with a reminder not a claim, so we want to update the arguments to make this clear. The reminders forms likely shouldn't share the same base class as the answers forms but changing this is outside of the scope of this rather large pr!
- Loading branch information
Showing
5 changed files
with
18 additions
and
59 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
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
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,7 +1,7 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe Journeys::AdditionalPaymentsForTeaching::Reminders::PersonalDetailsForm, type: :model do | ||
subject(:form) { described_class.new(claim: form_data_object, journey:, journey_session:, params:) } | ||
subject(:form) { described_class.new(reminder: form_data_object, journey:, journey_session:, params:) } | ||
|
||
let(:journey) { Journeys::AdditionalPaymentsForTeaching } | ||
let(:journey_session) { build(:additional_payments_session) } | ||
|
@@ -30,16 +30,13 @@ | |
describe "#save" do | ||
subject(:save) { form.save } | ||
|
||
before do | ||
allow(form).to receive(:update!).and_return(true) | ||
end | ||
|
||
context "valid params" do | ||
let(:form_params) { {"full_name" => "John Doe", "email_address" => "[email protected]"} } | ||
|
||
it "saves the attributes" do | ||
expect(save).to eq(true) | ||
expect(form).to have_received(:update!).with(form_params) | ||
expect(form_data_object.full_name).to eq("John Doe") | ||
expect(form_data_object.email_address).to eq("[email protected]") | ||
end | ||
end | ||
|
||
|
@@ -48,7 +45,8 @@ | |
|
||
it "does not save the attributes" do | ||
expect(save).to eq(false) | ||
expect(form).not_to have_received(:update!) | ||
expect(form_data_object.full_name).to be_nil | ||
expect(form_data_object.email_address).to be_nil | ||
end | ||
end | ||
end | ||
|