From 5de07c194e85fa74e7d7f2be12e99cb9acad3ccc Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 9 Sep 2017 17:37:13 +0200 Subject: Validate postcode properly. Don't accept invalid postcodes, or postcodes containing invalid chars. --- spec/support/contact_factory.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 spec/support/contact_factory.rb (limited to 'spec/support') diff --git a/spec/support/contact_factory.rb b/spec/support/contact_factory.rb new file mode 100644 index 0000000..f05e9a1 --- /dev/null +++ b/spec/support/contact_factory.rb @@ -0,0 +1,12 @@ +module ContactFactory + def create_contact_params(params = {}) + par = { + 'name' => 'Contact Name', + 'street' => "Streetname 666", + 'postcode' => "1234", + 'city' => "Someplace Nice", + 'phone' => '98765432', + 'email' => 'band@example.com', + }.merge(params) + end +end -- cgit v1.2.3