Merge branch 'crm' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Yan
2017-06-02 14:58:29 +06:30
4 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
class Crm::BookingsController < ApplicationController
def update_booking
booking = Booking.find(params[:booking_id])
status = booking.update_attributes(booking_status: params[:type])
if status == true
render json: JSON.generate({:status => true ,:type => params[:type]})
else
render json: JSON.generate({:status => false, :error_message => "Record not found"})
end
end
end

View File

@@ -0,0 +1,2 @@
module Crm::BookingsHelper
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe Crm::BookingsController, type: :controller do
end

View File

@@ -0,0 +1,15 @@
require 'rails_helper'
# Specs in this file have access to a helper object that includes
# the Crm::BookingsHelper. For example:
#
# describe Crm::BookingsHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# expect(helper.concat_strings("this","that")).to eq("this that")
# end
# end
# end
RSpec.describe Crm::BookingsHelper, type: :helper do
pending "add some examples to (or delete) #{__FILE__}"
end