summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-04-11 20:28:24 -0600
committerHombreLaser <sebastian-440@live.com>2023-04-11 20:28:24 -0600
commit26f5e92260a9b341376c494413f2b100b32c5a6a (patch)
tree406926b011debb2d61f8ced807d75488744d3ad9 /spec
parentb9e6c425a6142b2b78311cfc7b51aa0de7481440 (diff)
Añadidos specs de modelos para órdenes
Diffstat (limited to 'spec')
-rw-r--r--spec/models/order_spec.rb10
-rw-r--r--spec/models/payment_spec.rb6
-rw-r--r--spec/models/product_order_spec.rb8
3 files changed, 24 insertions, 0 deletions
diff --git a/spec/models/order_spec.rb b/spec/models/order_spec.rb
new file mode 100644
index 0000000..08be522
--- /dev/null
+++ b/spec/models/order_spec.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+RSpec.describe Order, type: :model do
+ it { should belong_to(:user_account) }
+ it { should have_one(:payment) }
+ it { should have_many(:product_orders) }
+ it { should have_many(:products) }
+end
diff --git a/spec/models/payment_spec.rb b/spec/models/payment_spec.rb
new file mode 100644
index 0000000..65bdeec
--- /dev/null
+++ b/spec/models/payment_spec.rb
@@ -0,0 +1,6 @@
+require 'rails_helper'
+
+RSpec.describe Payment, type: :model do
+ it { should have_one(:order) }
+ it { should belong_to(:card) }
+end
diff --git a/spec/models/product_order_spec.rb b/spec/models/product_order_spec.rb
new file mode 100644
index 0000000..0bd9199
--- /dev/null
+++ b/spec/models/product_order_spec.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+RSpec.describe ProductOrder, type: :model do
+ it { should belong_to(:product) }
+ it { should belong_to(:order) }
+end