From 7265af094ed16c36632128bccdcf84a3796c2359 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Sat, 25 Mar 2023 00:10:33 -0600 Subject: AƱade specs de addresscontroller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/support/address_helper.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 spec/support/address_helper.rb (limited to 'spec/support/address_helper.rb') diff --git a/spec/support/address_helper.rb b/spec/support/address_helper.rb new file mode 100644 index 0000000..7a678d5 --- /dev/null +++ b/spec/support/address_helper.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'rails_helper' + +# Module to form relationships between addresses and users. +module AddressHelper + def relate_user_and_addresses(user, addresses) + addresses.each do |address| + address.user_accounts << user + address.save + end + end + + def relate_user_and_address(user, address) + address.user_accounts << user + address.save + end +end -- cgit v1.2.3