menu, table,rooms, orders structure
This commit is contained in:
5
spec/models/customer_spec.rb
Normal file
5
spec/models/customer_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Customer, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
5
spec/models/dining_facility_spec.rb
Normal file
5
spec/models/dining_facility_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe DiningFacility, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
5
spec/models/dining_in_spec.rb
Normal file
5
spec/models/dining_in_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe DiningIn, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
@@ -4,4 +4,19 @@ RSpec.describe MenuCategory, type: :model do
|
||||
it { should validate_presence_of(:name) }
|
||||
it { should belong_to(:menu) }
|
||||
|
||||
describe ' #parent & #children' do
|
||||
it 'should be able to do parent tree' do
|
||||
menu = Menu.new(:name => "Test Category Menu", :is_active => true )
|
||||
menu.save!
|
||||
|
||||
c1 = MenuCategory.new(:name =>"Parent Category", :menu => menu)
|
||||
c1.save!
|
||||
c2 = MenuCategory.new(:name =>"Child Category", :menu => menu, :parent => c1)
|
||||
c2.save
|
||||
|
||||
expect(c1.children).to include(c2)
|
||||
expect(c2.parent).to eq c1
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
7
spec/models/menu_item_attribute_spec.rb
Normal file
7
spec/models/menu_item_attribute_spec.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe MenuItemAttribute, type: :model do
|
||||
it { should validate_presence_of(:attribute_type) }
|
||||
it { should validate_presence_of(:name) }
|
||||
it { should validate_presence_of(:value) }
|
||||
end
|
||||
5
spec/models/menu_item_instance_spec.rb
Normal file
5
spec/models/menu_item_instance_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe MenuItemInstance, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
6
spec/models/menu_item_option_spec.rb
Normal file
6
spec/models/menu_item_option_spec.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe MenuItemOption, type: :model do
|
||||
it { should validate_presence_of(:name) }
|
||||
it { should validate_presence_of(:value) }
|
||||
end
|
||||
5
spec/models/menu_item_spec.rb
Normal file
5
spec/models/menu_item_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe MenuItem, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
5
spec/models/order_item_spec.rb
Normal file
5
spec/models/order_item_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe OrderItem, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
5
spec/models/order_spec.rb
Normal file
5
spec/models/order_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Order, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
5
spec/models/room_booking_spec.rb
Normal file
5
spec/models/room_booking_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe RoomBooking, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
5
spec/models/room_order_spec.rb
Normal file
5
spec/models/room_order_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe RoomOrder, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
@@ -1,10 +0,0 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Room, type: :model do
|
||||
it { should belong_to(:zone) }
|
||||
|
||||
it { should validate_presence_of(:name) }
|
||||
it { should validate_presence_of(:seater) }
|
||||
it { should validate_presence_of(:is_active) }
|
||||
|
||||
end
|
||||
@@ -1,13 +0,0 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe SeatTable, type: :model do
|
||||
# Association test
|
||||
# ensure an item record belongs to a single todo record
|
||||
it { should belong_to(:zone) }
|
||||
# Validation test
|
||||
# ensure column name is present before saving
|
||||
it { should validate_presence_of(:name) }
|
||||
it { should validate_presence_of(:order_by) }
|
||||
it { should validate_presence_of(:created_by) }
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user