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
|
||||
@@ -1,25 +0,0 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'Seat Table API', type: :request do
|
||||
# initialize test data
|
||||
let!(:seat_table) { create_list(:seat_table, 10) }
|
||||
let(:seat_table_id) { seat_tables.first.id }
|
||||
|
||||
# Test suite for GET /todos
|
||||
describe 'GET /api/restaurant/seat_tables' do
|
||||
# make HTTP get request before each example
|
||||
before { get '/api/restaurant/seat_tables' }
|
||||
|
||||
it 'returns Seat Tables' do
|
||||
# Note `json` is a custom helper to parse JSON responses
|
||||
expect(json).not_to be_empty
|
||||
expect(json.size).to eq(10)
|
||||
end
|
||||
|
||||
it 'returns status code 200' do
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user