add zone test-rspec

This commit is contained in:
Min Zeya Phyo
2017-03-24 21:28:57 +06:30
parent 3ec71e85fe
commit a247cd44eb
19 changed files with 108 additions and 4 deletions

View File

@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

View File

@@ -0,0 +1,3 @@
// Place all the styles related to the api/restaurant/zone controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@@ -0,0 +1,4 @@
class Api::Restaurant::ZoneController < ApplicationController
def index
end
end

View File

@@ -0,0 +1,2 @@
module Api::Restaurant::ZoneHelper
end

View File

@@ -1,3 +1,6 @@
class SeatTable < ApplicationRecord
belongs_to :zone
# validations
validates_presence_of :name,:order_by, :created_by
end

View File

@@ -1,2 +1,7 @@
class Zone < ApplicationRecord
# model association
has_many :seat_tables, dependent: :destroy
# validations
validates_presence_of :name, :created_by
end

View File

@@ -0,0 +1,2 @@
<h1>Api::Restaurant::Zone#index</h1>
<p>Find me in app/views/api/restaurant/zone/index.html.erb</p>