Skip to content

Commit

Permalink
Fix command specs
Browse files Browse the repository at this point in the history
  • Loading branch information
fblupi committed Feb 14, 2024
1 parent 5c213d5 commit a4eb892
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions spec/commands/create_minor_account_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
module Decidim::Kids
describe CreateMinorAccount do
describe "call" do
let!(:current_user) { create(:user, :confirmed) }
let(:organization) { create :organization }
let!(:current_user) { create(:user, :confirmed, organization: organization) }

let!(:form) do
Decidim::Kids::MinorAccountForm.from_params(form_params)
MinorAccountForm.from_params(form_params).with_context(
current_organization: organization
)
end

let!(:command) { described_class.new(form, current_user) }
Expand All @@ -17,7 +20,7 @@ module Decidim::Kids
{
name: "Mike",
email: "[email protected]",
birthday: "01/11/2009",
birthday: "01/11/#{Time.zone.today.year - 12}",
tos_agreement: true
}
end
Expand Down
2 changes: 2 additions & 0 deletions spec/commands/update_minor_account_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ module Decidim::Kids
email: email,
birthday: birthday,
tos_agreement: tos_agreement
).with_context(
current_organization: organization
)
end

Expand Down

0 comments on commit a4eb892

Please sign in to comment.