menu, table,rooms, orders structure

This commit is contained in:
Min Zeya Phyo
2017-04-03 21:26:22 +06:30
parent 40423c12d3
commit 30b4a0f5ff
60 changed files with 536 additions and 101 deletions

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe Customer, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe DiningFacility, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe DiningIn, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -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

View 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

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe MenuItemInstance, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

View 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

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe MenuItem, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe OrderItem, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe Order, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe RoomBooking, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe RoomOrder, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -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

View File

@@ -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