Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
3
Gemfile
3
Gemfile
@@ -9,7 +9,8 @@ end
|
||||
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
||||
gem 'rails', '~> 5.0.2'
|
||||
# Use mysql as the database for Active Record
|
||||
gem 'mysql2', '>= 0.3.18', '< 0.5'
|
||||
#gem 'mysql2', '>= 0.3.18', '< 0.5'
|
||||
gem 'pg'
|
||||
# Use Puma as the app server
|
||||
gem 'puma', '~> 3.0'
|
||||
# Use SCSS for stylesheets
|
||||
|
||||
@@ -96,11 +96,11 @@ GEM
|
||||
mini_portile2 (2.1.0)
|
||||
minitest (5.10.1)
|
||||
multi_json (1.12.1)
|
||||
mysql2 (0.4.5)
|
||||
nio4r (2.0.0)
|
||||
nokogiri (1.7.1)
|
||||
mini_portile2 (~> 2.1.0)
|
||||
pdf-core (0.7.0)
|
||||
pg (0.20.0)
|
||||
prawn (2.2.2)
|
||||
pdf-core (~> 0.7.0)
|
||||
ttfunk (~> 1.5)
|
||||
@@ -230,7 +230,7 @@ DEPENDENCIES
|
||||
jbuilder (~> 2.5)
|
||||
jquery-rails
|
||||
listen (~> 3.0.5)
|
||||
mysql2 (>= 0.3.18, < 0.5)
|
||||
pg
|
||||
prawn
|
||||
prawn-table
|
||||
puma (~> 3.0)
|
||||
|
||||
74
app/controllers/crm/customers_controller.rb
Normal file
74
app/controllers/crm/customers_controller.rb
Normal file
@@ -0,0 +1,74 @@
|
||||
class Crm::CustomersController < ApplicationController
|
||||
before_action :set_crm_customer, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /crm/customers
|
||||
# GET /crm/customers.json
|
||||
def index
|
||||
@crm_customers = Crm::Customer.all
|
||||
end
|
||||
|
||||
# GET /crm/customers/1
|
||||
# GET /crm/customers/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /crm/customers/new
|
||||
def new
|
||||
@crm_customer = Crm::Customer.new
|
||||
end
|
||||
|
||||
# GET /crm/customers/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /crm/customers
|
||||
# POST /crm/customers.json
|
||||
def create
|
||||
@crm_customer = Crm::Customer.new(crm_customer_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @crm_customer.save
|
||||
format.html { redirect_to @crm_customer, notice: 'Customer was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @crm_customer }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: @crm_customer.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /crm/customers/1
|
||||
# PATCH/PUT /crm/customers/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @crm_customer.update(crm_customer_params)
|
||||
format.html { redirect_to @crm_customer, notice: 'Customer was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @crm_customer }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @crm_customer.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /crm/customers/1
|
||||
# DELETE /crm/customers/1.json
|
||||
def destroy
|
||||
@crm_customer.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to crm_customers_url, notice: 'Customer was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_crm_customer
|
||||
@crm_customer = Crm::Customer.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def crm_customer_params
|
||||
params.require(:crm_customer).permit(:name, :company, :contact_no, :email, :date_of_birth, :membership_id, :membership_type, :membership_authentication_code)
|
||||
end
|
||||
end
|
||||
74
app/controllers/settings/cashier_terminals_controller.rb
Normal file
74
app/controllers/settings/cashier_terminals_controller.rb
Normal file
@@ -0,0 +1,74 @@
|
||||
class Settings::CashierTerminalsController < ApplicationController
|
||||
before_action :set_settings_cashier_terminal, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /settings/cashier_terminals
|
||||
# GET /settings/cashier_terminals.json
|
||||
def index
|
||||
@settings_cashier_terminals = Settings::CashierTerminal.all
|
||||
end
|
||||
|
||||
# GET /settings/cashier_terminals/1
|
||||
# GET /settings/cashier_terminals/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /settings/cashier_terminals/new
|
||||
def new
|
||||
@settings_cashier_terminal = Settings::CashierTerminal.new
|
||||
end
|
||||
|
||||
# GET /settings/cashier_terminals/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /settings/cashier_terminals
|
||||
# POST /settings/cashier_terminals.json
|
||||
def create
|
||||
@settings_cashier_terminal = Settings::CashierTerminal.new(settings_cashier_terminal_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @settings_cashier_terminal.save
|
||||
format.html { redirect_to @settings_cashier_terminal, notice: 'Cashier terminal was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @settings_cashier_terminal }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: @settings_cashier_terminal.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /settings/cashier_terminals/1
|
||||
# PATCH/PUT /settings/cashier_terminals/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @settings_cashier_terminal.update(settings_cashier_terminal_params)
|
||||
format.html { redirect_to @settings_cashier_terminal, notice: 'Cashier terminal was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @settings_cashier_terminal }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @settings_cashier_terminal.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /settings/cashier_terminals/1
|
||||
# DELETE /settings/cashier_terminals/1.json
|
||||
def destroy
|
||||
@settings_cashier_terminal.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to settings_cashier_terminals_url, notice: 'Cashier terminal was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_settings_cashier_terminal
|
||||
@settings_cashier_terminal = Settings::CashierTerminal.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def settings_cashier_terminal_params
|
||||
params.require(:settings_cashier_terminal).permit(:name, :is_active, :is_currently_login, :auto_print_receipt, :printer_name, :header, :footer, :font, :font_size, :show_tax, :show_cashier, :show_guest_info)
|
||||
end
|
||||
end
|
||||
74
app/controllers/settings/lookups_controller.rb
Normal file
74
app/controllers/settings/lookups_controller.rb
Normal file
@@ -0,0 +1,74 @@
|
||||
class Settings::LookupsController < ApplicationController
|
||||
before_action :set_settings_lookup, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /settings/lookups
|
||||
# GET /settings/lookups.json
|
||||
def index
|
||||
@settings_lookups = Settings::Lookup.all
|
||||
end
|
||||
|
||||
# GET /settings/lookups/1
|
||||
# GET /settings/lookups/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /settings/lookups/new
|
||||
def new
|
||||
@settings_lookup = Settings::Lookup.new
|
||||
end
|
||||
|
||||
# GET /settings/lookups/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /settings/lookups
|
||||
# POST /settings/lookups.json
|
||||
def create
|
||||
@settings_lookup = Settings::Lookup.new(settings_lookup_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @settings_lookup.save
|
||||
format.html { redirect_to @settings_lookup, notice: 'Lookup was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @settings_lookup }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: @settings_lookup.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /settings/lookups/1
|
||||
# PATCH/PUT /settings/lookups/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @settings_lookup.update(settings_lookup_params)
|
||||
format.html { redirect_to @settings_lookup, notice: 'Lookup was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @settings_lookup }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @settings_lookup.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /settings/lookups/1
|
||||
# DELETE /settings/lookups/1.json
|
||||
def destroy
|
||||
@settings_lookup.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to settings_lookups_url, notice: 'Lookup was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_settings_lookup
|
||||
@settings_lookup = Settings::Lookup.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def settings_lookup_params
|
||||
params.require(:settings_lookup).permit(:lookup_type, :name, :value)
|
||||
end
|
||||
end
|
||||
74
app/controllers/settings/membership_settings_controller.rb
Normal file
74
app/controllers/settings/membership_settings_controller.rb
Normal file
@@ -0,0 +1,74 @@
|
||||
class Settings::MembershipSettingsController < ApplicationController
|
||||
before_action :set_settings_membership_setting, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /settings/membership_settings
|
||||
# GET /settings/membership_settings.json
|
||||
def index
|
||||
@settings_membership_settings = Settings::MembershipSetting.all
|
||||
end
|
||||
|
||||
# GET /settings/membership_settings/1
|
||||
# GET /settings/membership_settings/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /settings/membership_settings/new
|
||||
def new
|
||||
@settings_membership_setting = Settings::MembershipSetting.new
|
||||
end
|
||||
|
||||
# GET /settings/membership_settings/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /settings/membership_settings
|
||||
# POST /settings/membership_settings.json
|
||||
def create
|
||||
@settings_membership_setting = Settings::MembershipSetting.new(settings_membership_setting_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @settings_membership_setting.save
|
||||
format.html { redirect_to @settings_membership_setting, notice: 'Membership setting was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @settings_membership_setting }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: @settings_membership_setting.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /settings/membership_settings/1
|
||||
# PATCH/PUT /settings/membership_settings/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @settings_membership_setting.update(settings_membership_setting_params)
|
||||
format.html { redirect_to @settings_membership_setting, notice: 'Membership setting was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @settings_membership_setting }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @settings_membership_setting.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /settings/membership_settings/1
|
||||
# DELETE /settings/membership_settings/1.json
|
||||
def destroy
|
||||
@settings_membership_setting.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to settings_membership_settings_url, notice: 'Membership setting was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_settings_membership_setting
|
||||
@settings_membership_setting = Settings::MembershipSetting.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def settings_membership_setting_params
|
||||
params.require(:settings_membership_setting).permit(:membership_type, :is_active, :gateway_communication_type, :gateway_url, :auth_token, :merchant_account_id, :created_by)
|
||||
end
|
||||
end
|
||||
74
app/controllers/settings/menu_item_attributes_controller.rb
Normal file
74
app/controllers/settings/menu_item_attributes_controller.rb
Normal file
@@ -0,0 +1,74 @@
|
||||
class Settings::MenuItemAttributesController < ApplicationController
|
||||
before_action :set_settings_menu_item_attribute, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /settings/menu_item_attributes
|
||||
# GET /settings/menu_item_attributes.json
|
||||
def index
|
||||
@settings_menu_item_attributes = Settings::MenuItemAttribute.all
|
||||
end
|
||||
|
||||
# GET /settings/menu_item_attributes/1
|
||||
# GET /settings/menu_item_attributes/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /settings/menu_item_attributes/new
|
||||
def new
|
||||
@settings_menu_item_attribute = Settings::MenuItemAttribute.new
|
||||
end
|
||||
|
||||
# GET /settings/menu_item_attributes/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /settings/menu_item_attributes
|
||||
# POST /settings/menu_item_attributes.json
|
||||
def create
|
||||
@settings_menu_item_attribute = Settings::MenuItemAttribute.new(settings_menu_item_attribute_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @settings_menu_item_attribute.save
|
||||
format.html { redirect_to @settings_menu_item_attribute, notice: 'Menu item attribute was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @settings_menu_item_attribute }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: @settings_menu_item_attribute.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /settings/menu_item_attributes/1
|
||||
# PATCH/PUT /settings/menu_item_attributes/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @settings_menu_item_attribute.update(settings_menu_item_attribute_params)
|
||||
format.html { redirect_to @settings_menu_item_attribute, notice: 'Menu item attribute was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @settings_menu_item_attribute }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @settings_menu_item_attribute.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /settings/menu_item_attributes/1
|
||||
# DELETE /settings/menu_item_attributes/1.json
|
||||
def destroy
|
||||
@settings_menu_item_attribute.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to settings_menu_item_attributes_url, notice: 'Menu item attribute was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_settings_menu_item_attribute
|
||||
@settings_menu_item_attribute = Settings::MenuItemAttribute.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def settings_menu_item_attribute_params
|
||||
params.require(:settings_menu_item_attribute).permit(:attribute_type, :name, :value)
|
||||
end
|
||||
end
|
||||
74
app/controllers/settings/menu_item_options_controller.rb
Normal file
74
app/controllers/settings/menu_item_options_controller.rb
Normal file
@@ -0,0 +1,74 @@
|
||||
class Settings::MenuItemOptionsController < ApplicationController
|
||||
before_action :set_settings_menu_item_option, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /settings/menu_item_options
|
||||
# GET /settings/menu_item_options.json
|
||||
def index
|
||||
@settings_menu_item_options = Settings::MenuItemOption.all
|
||||
end
|
||||
|
||||
# GET /settings/menu_item_options/1
|
||||
# GET /settings/menu_item_options/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /settings/menu_item_options/new
|
||||
def new
|
||||
@settings_menu_item_option = Settings::MenuItemOption.new
|
||||
end
|
||||
|
||||
# GET /settings/menu_item_options/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /settings/menu_item_options
|
||||
# POST /settings/menu_item_options.json
|
||||
def create
|
||||
@settings_menu_item_option = Settings::MenuItemOption.new(settings_menu_item_option_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @settings_menu_item_option.save
|
||||
format.html { redirect_to @settings_menu_item_option, notice: 'Menu item option was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @settings_menu_item_option }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: @settings_menu_item_option.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /settings/menu_item_options/1
|
||||
# PATCH/PUT /settings/menu_item_options/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @settings_menu_item_option.update(settings_menu_item_option_params)
|
||||
format.html { redirect_to @settings_menu_item_option, notice: 'Menu item option was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @settings_menu_item_option }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @settings_menu_item_option.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /settings/menu_item_options/1
|
||||
# DELETE /settings/menu_item_options/1.json
|
||||
def destroy
|
||||
@settings_menu_item_option.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to settings_menu_item_options_url, notice: 'Menu item option was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_settings_menu_item_option
|
||||
@settings_menu_item_option = Settings::MenuItemOption.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def settings_menu_item_option_params
|
||||
params.require(:settings_menu_item_option).permit(:name, :value)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,74 @@
|
||||
class Settings::PaymentMethodSettingsController < ApplicationController
|
||||
before_action :set_settings_payment_method_setting, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /settings/payment_method_settings
|
||||
# GET /settings/payment_method_settings.json
|
||||
def index
|
||||
@settings_payment_method_settings = Settings::PaymentMethodSetting.all
|
||||
end
|
||||
|
||||
# GET /settings/payment_method_settings/1
|
||||
# GET /settings/payment_method_settings/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /settings/payment_method_settings/new
|
||||
def new
|
||||
@settings_payment_method_setting = Settings::PaymentMethodSetting.new
|
||||
end
|
||||
|
||||
# GET /settings/payment_method_settings/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /settings/payment_method_settings
|
||||
# POST /settings/payment_method_settings.json
|
||||
def create
|
||||
@settings_payment_method_setting = Settings::PaymentMethodSetting.new(settings_payment_method_setting_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @settings_payment_method_setting.save
|
||||
format.html { redirect_to @settings_payment_method_setting, notice: 'Payment method setting was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @settings_payment_method_setting }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: @settings_payment_method_setting.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /settings/payment_method_settings/1
|
||||
# PATCH/PUT /settings/payment_method_settings/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @settings_payment_method_setting.update(settings_payment_method_setting_params)
|
||||
format.html { redirect_to @settings_payment_method_setting, notice: 'Payment method setting was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @settings_payment_method_setting }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @settings_payment_method_setting.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /settings/payment_method_settings/1
|
||||
# DELETE /settings/payment_method_settings/1.json
|
||||
def destroy
|
||||
@settings_payment_method_setting.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to settings_payment_method_settings_url, notice: 'Payment method setting was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_settings_payment_method_setting
|
||||
@settings_payment_method_setting = Settings::PaymentMethodSetting.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def settings_payment_method_setting_params
|
||||
params.require(:settings_payment_method_setting).permit(:payment_method, :is_active, :gateway_communication_type, :gateway_url, :auth_token, :merchant_account_id)
|
||||
end
|
||||
end
|
||||
74
app/controllers/settings/zones_controller.rb
Normal file
74
app/controllers/settings/zones_controller.rb
Normal file
@@ -0,0 +1,74 @@
|
||||
class Settings::ZonesController < ApplicationController
|
||||
before_action :set_settings_zone, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /settings/zones
|
||||
# GET /settings/zones.json
|
||||
def index
|
||||
@settings_zones = Zone.all
|
||||
end
|
||||
|
||||
# GET /settings/zones/1
|
||||
# GET /settings/zones/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /settings/zones/new
|
||||
def new
|
||||
@settings_zone = Zone.new
|
||||
end
|
||||
|
||||
# GET /settings/zones/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /settings/zones
|
||||
# POST /settings/zones.json
|
||||
def create
|
||||
@settings_zone = Zone.new(settings_zone_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @settings_zone.save
|
||||
format.html { redirect_to @settings_zone, notice: 'Zone was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @settings_zone }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: @settings_zone.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /settings/zones/1
|
||||
# PATCH/PUT /settings/zones/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @settings_zone.update(settings_zone_params)
|
||||
format.html { redirect_to @settings_zone, notice: 'Zone was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @settings_zone }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @settings_zone.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /settings/zones/1
|
||||
# DELETE /settings/zones/1.json
|
||||
def destroy
|
||||
@settings_zone.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to settings_zones_url, notice: 'Zone was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_settings_zone
|
||||
@settings_zone = Zone.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def settings_zone_params
|
||||
params.require(:settings_zone).permit(:name, :is_active, :created_by)
|
||||
end
|
||||
end
|
||||
2
app/helpers/crm/customers_helper.rb
Normal file
2
app/helpers/crm/customers_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Crm::CustomersHelper
|
||||
end
|
||||
2
app/helpers/settings/cashier_terminals_helper.rb
Normal file
2
app/helpers/settings/cashier_terminals_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Settings::CashierTerminalsHelper
|
||||
end
|
||||
2
app/helpers/settings/lookups_helper.rb
Normal file
2
app/helpers/settings/lookups_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Settings::LookupsHelper
|
||||
end
|
||||
2
app/helpers/settings/membership_settings_helper.rb
Normal file
2
app/helpers/settings/membership_settings_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Settings::MembershipSettingsHelper
|
||||
end
|
||||
2
app/helpers/settings/menu_item_attributes_helper.rb
Normal file
2
app/helpers/settings/menu_item_attributes_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Settings::MenuItemAttributesHelper
|
||||
end
|
||||
2
app/helpers/settings/menu_item_options_helper.rb
Normal file
2
app/helpers/settings/menu_item_options_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Settings::MenuItemOptionsHelper
|
||||
end
|
||||
2
app/helpers/settings/payment_method_settings_helper.rb
Normal file
2
app/helpers/settings/payment_method_settings_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Settings::PaymentMethodSettingsHelper
|
||||
end
|
||||
2
app/helpers/settings/zones_helper.rb
Normal file
2
app/helpers/settings/zones_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Settings::ZonesHelper
|
||||
end
|
||||
2
app/views/crm/customers/_crm_customer.json.jbuilder
Normal file
2
app/views/crm/customers/_crm_customer.json.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
||||
json.extract! crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth, :membership_id, :membership_type, :membership_authentication_code, :created_at, :updated_at
|
||||
json.url crm_customer_url(crm_customer, format: :json)
|
||||
18
app/views/crm/customers/_form.html.erb
Normal file
18
app/views/crm/customers/_form.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<%= simple_form_for(@crm_customer) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :name %>
|
||||
<%= f.input :company %>
|
||||
<%= f.input :contact_no %>
|
||||
<%= f.input :email %>
|
||||
<%= f.input :date_of_birth %>
|
||||
<%= f.association :membership %>
|
||||
<%= f.input :membership_type %>
|
||||
<%= f.input :membership_authentication_code %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
6
app/views/crm/customers/edit.html.erb
Normal file
6
app/views/crm/customers/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing Crm Customer</h1>
|
||||
|
||||
<%= render 'form', crm_customer: @crm_customer %>
|
||||
|
||||
<%= link_to 'Show', @crm_customer %> |
|
||||
<%= link_to 'Back', crm_customers_path %>
|
||||
41
app/views/crm/customers/index.html.erb
Normal file
41
app/views/crm/customers/index.html.erb
Normal file
@@ -0,0 +1,41 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Crm Customers</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Company</th>
|
||||
<th>Contact no</th>
|
||||
<th>Email</th>
|
||||
<th>Date of birth</th>
|
||||
<th>Membership</th>
|
||||
<th>Membership type</th>
|
||||
<th>Membership authentication code</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @crm_customers.each do |crm_customer| %>
|
||||
<tr>
|
||||
<td><%= crm_customer.name %></td>
|
||||
<td><%= crm_customer.company %></td>
|
||||
<td><%= crm_customer.contact_no %></td>
|
||||
<td><%= crm_customer.email %></td>
|
||||
<td><%= crm_customer.date_of_birth %></td>
|
||||
<td><%= crm_customer.membership %></td>
|
||||
<td><%= crm_customer.membership_type %></td>
|
||||
<td><%= crm_customer.membership_authentication_code %></td>
|
||||
<td><%= link_to 'Show', crm_customer %></td>
|
||||
<td><%= link_to 'Edit', edit_crm_customer_path(crm_customer) %></td>
|
||||
<td><%= link_to 'Destroy', crm_customer, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Crm Customer', new_crm_customer_path %>
|
||||
1
app/views/crm/customers/index.json.jbuilder
Normal file
1
app/views/crm/customers/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @crm_customers, partial: 'crm_customers/crm_customer', as: :crm_customer
|
||||
5
app/views/crm/customers/new.html.erb
Normal file
5
app/views/crm/customers/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Crm Customer</h1>
|
||||
|
||||
<%= render 'form', crm_customer: @crm_customer %>
|
||||
|
||||
<%= link_to 'Back', crm_customers_path %>
|
||||
44
app/views/crm/customers/show.html.erb
Normal file
44
app/views/crm/customers/show.html.erb
Normal file
@@ -0,0 +1,44 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<strong>Name:</strong>
|
||||
<%= @crm_customer.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Company:</strong>
|
||||
<%= @crm_customer.company %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Contact no:</strong>
|
||||
<%= @crm_customer.contact_no %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Email:</strong>
|
||||
<%= @crm_customer.email %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Date of birth:</strong>
|
||||
<%= @crm_customer.date_of_birth %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Membership:</strong>
|
||||
<%= @crm_customer.membership %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Membership type:</strong>
|
||||
<%= @crm_customer.membership_type %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Membership authentication code:</strong>
|
||||
<%= @crm_customer.membership_authentication_code %>
|
||||
</p>
|
||||
|
||||
<%= link_to 'Edit', edit_crm_customer_path(@crm_customer) %> |
|
||||
<%= link_to 'Back', crm_customers_path %>
|
||||
1
app/views/crm/customers/show.json.jbuilder
Normal file
1
app/views/crm/customers/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "crm_customers/crm_customer", crm_customer: @crm_customer
|
||||
22
app/views/settings/cashier_terminals/_form.html.erb
Normal file
22
app/views/settings/cashier_terminals/_form.html.erb
Normal file
@@ -0,0 +1,22 @@
|
||||
<%= simple_form_for(@settings_cashier_terminal) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :name %>
|
||||
<%= f.input :is_active %>
|
||||
<%= f.input :is_currently_login %>
|
||||
<%= f.input :auto_print_receipt %>
|
||||
<%= f.input :printer_name %>
|
||||
<%= f.input :header %>
|
||||
<%= f.input :footer %>
|
||||
<%= f.input :font %>
|
||||
<%= f.input :font_size %>
|
||||
<%= f.input :show_tax %>
|
||||
<%= f.input :show_cashier %>
|
||||
<%= f.input :show_guest_info %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,2 @@
|
||||
json.extract! settings_cashier_terminal, :id, :name, :is_active, :is_currently_login, :auto_print_receipt, :printer_name, :header, :footer, :font, :font_size, :show_tax, :show_cashier, :show_guest_info, :created_at, :updated_at
|
||||
json.url settings_cashier_terminal_url(settings_cashier_terminal, format: :json)
|
||||
6
app/views/settings/cashier_terminals/edit.html.erb
Normal file
6
app/views/settings/cashier_terminals/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing Settings Cashier Terminal</h1>
|
||||
|
||||
<%= render 'form', settings_cashier_terminal: @settings_cashier_terminal %>
|
||||
|
||||
<%= link_to 'Show', @settings_cashier_terminal %> |
|
||||
<%= link_to 'Back', settings_cashier_terminals_path %>
|
||||
49
app/views/settings/cashier_terminals/index.html.erb
Normal file
49
app/views/settings/cashier_terminals/index.html.erb
Normal file
@@ -0,0 +1,49 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Settings Cashier Terminals</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Is active</th>
|
||||
<th>Is currently login</th>
|
||||
<th>Auto print receipt</th>
|
||||
<th>Printer name</th>
|
||||
<th>Header</th>
|
||||
<th>Footer</th>
|
||||
<th>Font</th>
|
||||
<th>Font size</th>
|
||||
<th>Show tax</th>
|
||||
<th>Show cashier</th>
|
||||
<th>Show guest info</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @settings_cashier_terminals.each do |settings_cashier_terminal| %>
|
||||
<tr>
|
||||
<td><%= settings_cashier_terminal.name %></td>
|
||||
<td><%= settings_cashier_terminal.is_active %></td>
|
||||
<td><%= settings_cashier_terminal.is_currently_login %></td>
|
||||
<td><%= settings_cashier_terminal.auto_print_receipt %></td>
|
||||
<td><%= settings_cashier_terminal.printer_name %></td>
|
||||
<td><%= settings_cashier_terminal.header %></td>
|
||||
<td><%= settings_cashier_terminal.footer %></td>
|
||||
<td><%= settings_cashier_terminal.font %></td>
|
||||
<td><%= settings_cashier_terminal.font_size %></td>
|
||||
<td><%= settings_cashier_terminal.show_tax %></td>
|
||||
<td><%= settings_cashier_terminal.show_cashier %></td>
|
||||
<td><%= settings_cashier_terminal.show_guest_info %></td>
|
||||
<td><%= link_to 'Show', settings_cashier_terminal %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_cashier_terminal_path(settings_cashier_terminal) %></td>
|
||||
<td><%= link_to 'Destroy', settings_cashier_terminal, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Settings Cashier Terminal', new_settings_cashier_terminal_path %>
|
||||
1
app/views/settings/cashier_terminals/index.json.jbuilder
Normal file
1
app/views/settings/cashier_terminals/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @settings_cashier_terminals, partial: 'settings_cashier_terminals/settings_cashier_terminal', as: :settings_cashier_terminal
|
||||
5
app/views/settings/cashier_terminals/new.html.erb
Normal file
5
app/views/settings/cashier_terminals/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Settings Cashier Terminal</h1>
|
||||
|
||||
<%= render 'form', settings_cashier_terminal: @settings_cashier_terminal %>
|
||||
|
||||
<%= link_to 'Back', settings_cashier_terminals_path %>
|
||||
64
app/views/settings/cashier_terminals/show.html.erb
Normal file
64
app/views/settings/cashier_terminals/show.html.erb
Normal file
@@ -0,0 +1,64 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<strong>Name:</strong>
|
||||
<%= @settings_cashier_terminal.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Is active:</strong>
|
||||
<%= @settings_cashier_terminal.is_active %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Is currently login:</strong>
|
||||
<%= @settings_cashier_terminal.is_currently_login %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Auto print receipt:</strong>
|
||||
<%= @settings_cashier_terminal.auto_print_receipt %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Printer name:</strong>
|
||||
<%= @settings_cashier_terminal.printer_name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Header:</strong>
|
||||
<%= @settings_cashier_terminal.header %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Footer:</strong>
|
||||
<%= @settings_cashier_terminal.footer %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Font:</strong>
|
||||
<%= @settings_cashier_terminal.font %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Font size:</strong>
|
||||
<%= @settings_cashier_terminal.font_size %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Show tax:</strong>
|
||||
<%= @settings_cashier_terminal.show_tax %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Show cashier:</strong>
|
||||
<%= @settings_cashier_terminal.show_cashier %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Show guest info:</strong>
|
||||
<%= @settings_cashier_terminal.show_guest_info %>
|
||||
</p>
|
||||
|
||||
<%= link_to 'Edit', edit_settings_cashier_terminal_path(@settings_cashier_terminal) %> |
|
||||
<%= link_to 'Back', settings_cashier_terminals_path %>
|
||||
1
app/views/settings/cashier_terminals/show.json.jbuilder
Normal file
1
app/views/settings/cashier_terminals/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "settings_cashier_terminals/settings_cashier_terminal", settings_cashier_terminal: @settings_cashier_terminal
|
||||
13
app/views/settings/lookups/_form.html.erb
Normal file
13
app/views/settings/lookups/_form.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%= simple_form_for(@settings_lookup) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :lookup_type %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :value %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,2 @@
|
||||
json.extract! settings_lookup, :id, :lookup_type, :name, :value, :created_at, :updated_at
|
||||
json.url settings_lookup_url(settings_lookup, format: :json)
|
||||
6
app/views/settings/lookups/edit.html.erb
Normal file
6
app/views/settings/lookups/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing Settings Lookup</h1>
|
||||
|
||||
<%= render 'form', settings_lookup: @settings_lookup %>
|
||||
|
||||
<%= link_to 'Show', @settings_lookup %> |
|
||||
<%= link_to 'Back', settings_lookups_path %>
|
||||
31
app/views/settings/lookups/index.html.erb
Normal file
31
app/views/settings/lookups/index.html.erb
Normal file
@@ -0,0 +1,31 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Settings Lookups</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Lookup type</th>
|
||||
<th>Name</th>
|
||||
<th>Value</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @settings_lookups.each do |settings_lookup| %>
|
||||
<tr>
|
||||
<td><%= settings_lookup.lookup_type %></td>
|
||||
<td><%= settings_lookup.name %></td>
|
||||
<td><%= settings_lookup.value %></td>
|
||||
<td><%= link_to 'Show', settings_lookup %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_lookup_path(settings_lookup) %></td>
|
||||
<td><%= link_to 'Destroy', settings_lookup, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Settings Lookup', new_settings_lookup_path %>
|
||||
1
app/views/settings/lookups/index.json.jbuilder
Normal file
1
app/views/settings/lookups/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @settings_lookups, partial: 'settings_lookups/settings_lookup', as: :settings_lookup
|
||||
5
app/views/settings/lookups/new.html.erb
Normal file
5
app/views/settings/lookups/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Settings Lookup</h1>
|
||||
|
||||
<%= render 'form', settings_lookup: @settings_lookup %>
|
||||
|
||||
<%= link_to 'Back', settings_lookups_path %>
|
||||
19
app/views/settings/lookups/show.html.erb
Normal file
19
app/views/settings/lookups/show.html.erb
Normal file
@@ -0,0 +1,19 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<strong>Lookup type:</strong>
|
||||
<%= @settings_lookup.lookup_type %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Name:</strong>
|
||||
<%= @settings_lookup.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Value:</strong>
|
||||
<%= @settings_lookup.value %>
|
||||
</p>
|
||||
|
||||
<%= link_to 'Edit', edit_settings_lookup_path(@settings_lookup) %> |
|
||||
<%= link_to 'Back', settings_lookups_path %>
|
||||
1
app/views/settings/lookups/show.json.jbuilder
Normal file
1
app/views/settings/lookups/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "settings_lookups/settings_lookup", settings_lookup: @settings_lookup
|
||||
17
app/views/settings/membership_settings/_form.html.erb
Normal file
17
app/views/settings/membership_settings/_form.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<%= simple_form_for(@settings_membership_setting) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :membership_type %>
|
||||
<%= f.input :is_active %>
|
||||
<%= f.input :gateway_communication_type %>
|
||||
<%= f.input :gateway_url %>
|
||||
<%= f.input :auth_token %>
|
||||
<%= f.association :merchant_account %>
|
||||
<%= f.input :created_by %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,2 @@
|
||||
json.extract! settings_membership_setting, :id, :membership_type, :is_active, :gateway_communication_type, :gateway_url, :auth_token, :merchant_account_id, :created_by, :created_at, :updated_at
|
||||
json.url settings_membership_setting_url(settings_membership_setting, format: :json)
|
||||
6
app/views/settings/membership_settings/edit.html.erb
Normal file
6
app/views/settings/membership_settings/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing Settings Membership Setting</h1>
|
||||
|
||||
<%= render 'form', settings_membership_setting: @settings_membership_setting %>
|
||||
|
||||
<%= link_to 'Show', @settings_membership_setting %> |
|
||||
<%= link_to 'Back', settings_membership_settings_path %>
|
||||
39
app/views/settings/membership_settings/index.html.erb
Normal file
39
app/views/settings/membership_settings/index.html.erb
Normal file
@@ -0,0 +1,39 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Settings Membership Settings</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Membership type</th>
|
||||
<th>Is active</th>
|
||||
<th>Gateway communication type</th>
|
||||
<th>Gateway url</th>
|
||||
<th>Auth token</th>
|
||||
<th>Merchant account</th>
|
||||
<th>Created by</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @settings_membership_settings.each do |settings_membership_setting| %>
|
||||
<tr>
|
||||
<td><%= settings_membership_setting.membership_type %></td>
|
||||
<td><%= settings_membership_setting.is_active %></td>
|
||||
<td><%= settings_membership_setting.gateway_communication_type %></td>
|
||||
<td><%= settings_membership_setting.gateway_url %></td>
|
||||
<td><%= settings_membership_setting.auth_token %></td>
|
||||
<td><%= settings_membership_setting.merchant_account %></td>
|
||||
<td><%= settings_membership_setting.created_by %></td>
|
||||
<td><%= link_to 'Show', settings_membership_setting %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_membership_setting_path(settings_membership_setting) %></td>
|
||||
<td><%= link_to 'Destroy', settings_membership_setting, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Settings Membership Setting', new_settings_membership_setting_path %>
|
||||
@@ -0,0 +1 @@
|
||||
json.array! @settings_membership_settings, partial: 'settings_membership_settings/settings_membership_setting', as: :settings_membership_setting
|
||||
5
app/views/settings/membership_settings/new.html.erb
Normal file
5
app/views/settings/membership_settings/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Settings Membership Setting</h1>
|
||||
|
||||
<%= render 'form', settings_membership_setting: @settings_membership_setting %>
|
||||
|
||||
<%= link_to 'Back', settings_membership_settings_path %>
|
||||
39
app/views/settings/membership_settings/show.html.erb
Normal file
39
app/views/settings/membership_settings/show.html.erb
Normal file
@@ -0,0 +1,39 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<strong>Membership type:</strong>
|
||||
<%= @settings_membership_setting.membership_type %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Is active:</strong>
|
||||
<%= @settings_membership_setting.is_active %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Gateway communication type:</strong>
|
||||
<%= @settings_membership_setting.gateway_communication_type %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Gateway url:</strong>
|
||||
<%= @settings_membership_setting.gateway_url %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Auth token:</strong>
|
||||
<%= @settings_membership_setting.auth_token %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Merchant account:</strong>
|
||||
<%= @settings_membership_setting.merchant_account %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Created by:</strong>
|
||||
<%= @settings_membership_setting.created_by %>
|
||||
</p>
|
||||
|
||||
<%= link_to 'Edit', edit_settings_membership_setting_path(@settings_membership_setting) %> |
|
||||
<%= link_to 'Back', settings_membership_settings_path %>
|
||||
@@ -0,0 +1 @@
|
||||
json.partial! "settings_membership_settings/settings_membership_setting", settings_membership_setting: @settings_membership_setting
|
||||
@@ -8,6 +8,7 @@
|
||||
<%= f.input :alt_name %>
|
||||
<%= f.input :order_by %>
|
||||
<%= f.association :parent %>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Settings Menu Categories</h1>
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= %>">Home</a></li>
|
||||
<li>Menu Categories</li>
|
||||
<span style="float: right">
|
||||
<%= link_to t('.new', :default => t("helpers.links.new")),new_settings_menu_category_path,:class => 'btn btn-primary btn-sm' %>
|
||||
</span>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<br>
|
||||
<div class="card">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Menu</th>
|
||||
@@ -10,26 +19,23 @@
|
||||
<th>Alt name</th>
|
||||
<th>Order by</th>
|
||||
<th>Parent</th>
|
||||
<th colspan="3"></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @settings_menu_categories.each do |settings_menu_category| %>
|
||||
<tr>
|
||||
<td><%= settings_menu_category.menu %></td>
|
||||
<td><%= settings_menu_category.name %></td>
|
||||
<td><%= settings_menu_category.alt_name %></td>
|
||||
<td><%= settings_menu_category.order_by %></td>
|
||||
<td><%= settings_menu_category.parent.name %></td>
|
||||
<td><%= link_to 'Show', settings_menu_category %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_menu_category_path(settings_menu_category) %></td>
|
||||
<td><%= link_to 'Destroy', settings_menu_category, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
<td><%= settings_menu_category.menu rescue '' %></td>
|
||||
<td><%= settings_menu_category.name rescue ''%></td>
|
||||
<td><%= settings_menu_category.alt_name rescue ''%></td>
|
||||
<td><%= settings_menu_category.order_by rescue ''%></td>
|
||||
<td><%= settings_menu_category.parent.name rescue ''%></td>
|
||||
<td><%= link_to 'Edit', edit_settings_menu_category_path(settings_menu_category) %> | <%= link_to 'Destroy', method: :delete, data: { confirm: 'Are you sure?' } %></td></td>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Settings Menu Category', new_settings_menu_category_path %>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<h1>New Settings Menu Category</h1>
|
||||
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_menu_categories_path %>">Menu Categories</a></li>
|
||||
<li>New</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', settings_menu_category: @settings_menu_category %>
|
||||
|
||||
<%= link_to 'Back', settings_menu_categories_path %>
|
||||
</div>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
<p>
|
||||
<strong>Menu category:</strong>
|
||||
<%= @settings_menu_category.menu_category %>
|
||||
<%= @settings_menu_category.menu_category rescue '' %>
|
||||
</p>
|
||||
|
||||
<%= link_to 'Edit', edit_settings_menu_category_path(@settings_menu_category) %> |
|
||||
|
||||
13
app/views/settings/menu_item_attributes/_form.html.erb
Normal file
13
app/views/settings/menu_item_attributes/_form.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%= simple_form_for(@settings_menu_item_attribute) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :attribute_type %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :value %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,2 @@
|
||||
json.extract! settings_menu_item_attribute, :id, :attribute_type, :name, :value, :created_at, :updated_at
|
||||
json.url settings_menu_item_attribute_url(settings_menu_item_attribute, format: :json)
|
||||
6
app/views/settings/menu_item_attributes/edit.html.erb
Normal file
6
app/views/settings/menu_item_attributes/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing Settings Menu Item Attribute</h1>
|
||||
|
||||
<%= render 'form', settings_menu_item_attribute: @settings_menu_item_attribute %>
|
||||
|
||||
<%= link_to 'Show', @settings_menu_item_attribute %> |
|
||||
<%= link_to 'Back', settings_menu_item_attributes_path %>
|
||||
31
app/views/settings/menu_item_attributes/index.html.erb
Normal file
31
app/views/settings/menu_item_attributes/index.html.erb
Normal file
@@ -0,0 +1,31 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Settings Menu Item Attributes</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Attribute type</th>
|
||||
<th>Name</th>
|
||||
<th>Value</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @settings_menu_item_attributes.each do |settings_menu_item_attribute| %>
|
||||
<tr>
|
||||
<td><%= settings_menu_item_attribute.attribute_type %></td>
|
||||
<td><%= settings_menu_item_attribute.name %></td>
|
||||
<td><%= settings_menu_item_attribute.value %></td>
|
||||
<td><%= link_to 'Show', settings_menu_item_attribute %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_menu_item_attribute_path(settings_menu_item_attribute) %></td>
|
||||
<td><%= link_to 'Destroy', settings_menu_item_attribute, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Settings Menu Item Attribute', new_settings_menu_item_attribute_path %>
|
||||
@@ -0,0 +1 @@
|
||||
json.array! @settings_menu_item_attributes, partial: 'settings_menu_item_attributes/settings_menu_item_attribute', as: :settings_menu_item_attribute
|
||||
5
app/views/settings/menu_item_attributes/new.html.erb
Normal file
5
app/views/settings/menu_item_attributes/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Settings Menu Item Attribute</h1>
|
||||
|
||||
<%= render 'form', settings_menu_item_attribute: @settings_menu_item_attribute %>
|
||||
|
||||
<%= link_to 'Back', settings_menu_item_attributes_path %>
|
||||
19
app/views/settings/menu_item_attributes/show.html.erb
Normal file
19
app/views/settings/menu_item_attributes/show.html.erb
Normal file
@@ -0,0 +1,19 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<strong>Attribute type:</strong>
|
||||
<%= @settings_menu_item_attribute.attribute_type %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Name:</strong>
|
||||
<%= @settings_menu_item_attribute.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Value:</strong>
|
||||
<%= @settings_menu_item_attribute.value %>
|
||||
</p>
|
||||
|
||||
<%= link_to 'Edit', edit_settings_menu_item_attribute_path(@settings_menu_item_attribute) %> |
|
||||
<%= link_to 'Back', settings_menu_item_attributes_path %>
|
||||
@@ -0,0 +1 @@
|
||||
json.partial! "settings_menu_item_attributes/settings_menu_item_attribute", settings_menu_item_attribute: @settings_menu_item_attribute
|
||||
12
app/views/settings/menu_item_options/_form.html.erb
Normal file
12
app/views/settings/menu_item_options/_form.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<%= simple_form_for(@settings_menu_item_option) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :name %>
|
||||
<%= f.input :value %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,2 @@
|
||||
json.extract! settings_menu_item_option, :id, :name, :value, :created_at, :updated_at
|
||||
json.url settings_menu_item_option_url(settings_menu_item_option, format: :json)
|
||||
6
app/views/settings/menu_item_options/edit.html.erb
Normal file
6
app/views/settings/menu_item_options/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing Settings Menu Item Option</h1>
|
||||
|
||||
<%= render 'form', settings_menu_item_option: @settings_menu_item_option %>
|
||||
|
||||
<%= link_to 'Show', @settings_menu_item_option %> |
|
||||
<%= link_to 'Back', settings_menu_item_options_path %>
|
||||
29
app/views/settings/menu_item_options/index.html.erb
Normal file
29
app/views/settings/menu_item_options/index.html.erb
Normal file
@@ -0,0 +1,29 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Settings Menu Item Options</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Value</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @settings_menu_item_options.each do |settings_menu_item_option| %>
|
||||
<tr>
|
||||
<td><%= settings_menu_item_option.name %></td>
|
||||
<td><%= settings_menu_item_option.value %></td>
|
||||
<td><%= link_to 'Show', settings_menu_item_option %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_menu_item_option_path(settings_menu_item_option) %></td>
|
||||
<td><%= link_to 'Destroy', settings_menu_item_option, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Settings Menu Item Option', new_settings_menu_item_option_path %>
|
||||
1
app/views/settings/menu_item_options/index.json.jbuilder
Normal file
1
app/views/settings/menu_item_options/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @settings_menu_item_options, partial: 'settings_menu_item_options/settings_menu_item_option', as: :settings_menu_item_option
|
||||
5
app/views/settings/menu_item_options/new.html.erb
Normal file
5
app/views/settings/menu_item_options/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Settings Menu Item Option</h1>
|
||||
|
||||
<%= render 'form', settings_menu_item_option: @settings_menu_item_option %>
|
||||
|
||||
<%= link_to 'Back', settings_menu_item_options_path %>
|
||||
14
app/views/settings/menu_item_options/show.html.erb
Normal file
14
app/views/settings/menu_item_options/show.html.erb
Normal file
@@ -0,0 +1,14 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<strong>Name:</strong>
|
||||
<%= @settings_menu_item_option.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Value:</strong>
|
||||
<%= @settings_menu_item_option.value %>
|
||||
</p>
|
||||
|
||||
<%= link_to 'Edit', edit_settings_menu_item_option_path(@settings_menu_item_option) %> |
|
||||
<%= link_to 'Back', settings_menu_item_options_path %>
|
||||
1
app/views/settings/menu_item_options/show.json.jbuilder
Normal file
1
app/views/settings/menu_item_options/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "settings_menu_item_options/settings_menu_item_option", settings_menu_item_option: @settings_menu_item_option
|
||||
16
app/views/settings/payment_method_settings/_form.html.erb
Normal file
16
app/views/settings/payment_method_settings/_form.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<%= simple_form_for(@settings_payment_method_setting) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :payment_method %>
|
||||
<%= f.input :is_active %>
|
||||
<%= f.input :gateway_communication_type %>
|
||||
<%= f.input :gateway_url %>
|
||||
<%= f.input :auth_token %>
|
||||
<%= f.association :merchant_account %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,2 @@
|
||||
json.extract! settings_payment_method_setting, :id, :payment_method, :is_active, :gateway_communication_type, :gateway_url, :auth_token, :merchant_account_id, :created_at, :updated_at
|
||||
json.url settings_payment_method_setting_url(settings_payment_method_setting, format: :json)
|
||||
6
app/views/settings/payment_method_settings/edit.html.erb
Normal file
6
app/views/settings/payment_method_settings/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing Settings Payment Method Setting</h1>
|
||||
|
||||
<%= render 'form', settings_payment_method_setting: @settings_payment_method_setting %>
|
||||
|
||||
<%= link_to 'Show', @settings_payment_method_setting %> |
|
||||
<%= link_to 'Back', settings_payment_method_settings_path %>
|
||||
37
app/views/settings/payment_method_settings/index.html.erb
Normal file
37
app/views/settings/payment_method_settings/index.html.erb
Normal file
@@ -0,0 +1,37 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Settings Payment Method Settings</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Payment method</th>
|
||||
<th>Is active</th>
|
||||
<th>Gateway communication type</th>
|
||||
<th>Gateway url</th>
|
||||
<th>Auth token</th>
|
||||
<th>Merchant account</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @settings_payment_method_settings.each do |settings_payment_method_setting| %>
|
||||
<tr>
|
||||
<td><%= settings_payment_method_setting.payment_method %></td>
|
||||
<td><%= settings_payment_method_setting.is_active %></td>
|
||||
<td><%= settings_payment_method_setting.gateway_communication_type %></td>
|
||||
<td><%= settings_payment_method_setting.gateway_url %></td>
|
||||
<td><%= settings_payment_method_setting.auth_token %></td>
|
||||
<td><%= settings_payment_method_setting.merchant_account %></td>
|
||||
<td><%= link_to 'Show', settings_payment_method_setting %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_payment_method_setting_path(settings_payment_method_setting) %></td>
|
||||
<td><%= link_to 'Destroy', settings_payment_method_setting, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Settings Payment Method Setting', new_settings_payment_method_setting_path %>
|
||||
@@ -0,0 +1 @@
|
||||
json.array! @settings_payment_method_settings, partial: 'settings_payment_method_settings/settings_payment_method_setting', as: :settings_payment_method_setting
|
||||
5
app/views/settings/payment_method_settings/new.html.erb
Normal file
5
app/views/settings/payment_method_settings/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Settings Payment Method Setting</h1>
|
||||
|
||||
<%= render 'form', settings_payment_method_setting: @settings_payment_method_setting %>
|
||||
|
||||
<%= link_to 'Back', settings_payment_method_settings_path %>
|
||||
34
app/views/settings/payment_method_settings/show.html.erb
Normal file
34
app/views/settings/payment_method_settings/show.html.erb
Normal file
@@ -0,0 +1,34 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<strong>Payment method:</strong>
|
||||
<%= @settings_payment_method_setting.payment_method %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Is active:</strong>
|
||||
<%= @settings_payment_method_setting.is_active %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Gateway communication type:</strong>
|
||||
<%= @settings_payment_method_setting.gateway_communication_type %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Gateway url:</strong>
|
||||
<%= @settings_payment_method_setting.gateway_url %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Auth token:</strong>
|
||||
<%= @settings_payment_method_setting.auth_token %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Merchant account:</strong>
|
||||
<%= @settings_payment_method_setting.merchant_account %>
|
||||
</p>
|
||||
|
||||
<%= link_to 'Edit', edit_settings_payment_method_setting_path(@settings_payment_method_setting) %> |
|
||||
<%= link_to 'Back', settings_payment_method_settings_path %>
|
||||
@@ -0,0 +1 @@
|
||||
json.partial! "settings_payment_method_settings/settings_payment_method_setting", settings_payment_method_setting: @settings_payment_method_setting
|
||||
13
app/views/settings/zones/_form.html.erb
Normal file
13
app/views/settings/zones/_form.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%= simple_form_for(@settings_zone) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :name %>
|
||||
<%= f.input :is_active %>
|
||||
<%= f.input :created_by %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
2
app/views/settings/zones/_settings_zone.json.jbuilder
Normal file
2
app/views/settings/zones/_settings_zone.json.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
||||
json.extract! settings_zone, :id, :name, :is_active, :created_by, :created_at, :updated_at
|
||||
json.url settings_zone_url(settings_zone, format: :json)
|
||||
6
app/views/settings/zones/edit.html.erb
Normal file
6
app/views/settings/zones/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing Settings Zone</h1>
|
||||
|
||||
<%= render 'form', settings_zone: @settings_zone %>
|
||||
|
||||
<%= link_to 'Show', @settings_zone %> |
|
||||
<%= link_to 'Back', settings_zones_path %>
|
||||
31
app/views/settings/zones/index.html.erb
Normal file
31
app/views/settings/zones/index.html.erb
Normal file
@@ -0,0 +1,31 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Settings Zones</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Is active</th>
|
||||
<th>Created by</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @settings_zones.each do |settings_zone| %>
|
||||
<tr>
|
||||
<td><%= settings_zone.name %></td>
|
||||
<td><%= settings_zone.is_active %></td>
|
||||
<td><%= settings_zone.created_by %></td>
|
||||
<td><%= link_to 'Show', settings_zone %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_zone_path(settings_zone) %></td>
|
||||
<td><%= link_to 'Destroy', settings_zone, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Settings Zone', new_settings_zone_path %>
|
||||
1
app/views/settings/zones/index.json.jbuilder
Normal file
1
app/views/settings/zones/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @settings_zones, partial: 'settings_zones/settings_zone', as: :settings_zone
|
||||
5
app/views/settings/zones/new.html.erb
Normal file
5
app/views/settings/zones/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Settings Zone</h1>
|
||||
|
||||
<%= render 'form', settings_zone: @settings_zone %>
|
||||
|
||||
<%= link_to 'Back', settings_zones_path %>
|
||||
19
app/views/settings/zones/show.html.erb
Normal file
19
app/views/settings/zones/show.html.erb
Normal file
@@ -0,0 +1,19 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<strong>Name:</strong>
|
||||
<%= @settings_zone.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Is active:</strong>
|
||||
<%= @settings_zone.is_active %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Created by:</strong>
|
||||
<%= @settings_zone.created_by %>
|
||||
</p>
|
||||
|
||||
<%= link_to 'Edit', edit_settings_zone_path(@settings_zone) %> |
|
||||
<%= link_to 'Back', settings_zones_path %>
|
||||
1
app/views/settings/zones/show.json.jbuilder
Normal file
1
app/views/settings/zones/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "settings_zones/settings_zone", settings_zone: @settings_zone
|
||||
@@ -74,6 +74,7 @@ Rails.application.routes.draw do
|
||||
#--------- Customer Relationship Management ------------#
|
||||
namespace :crm do
|
||||
#customers
|
||||
resources :customers
|
||||
#membership
|
||||
#bookings
|
||||
#queue
|
||||
@@ -103,17 +104,28 @@ Rails.application.routes.draw do
|
||||
resources :menu_items do
|
||||
resources :menu_item_instances
|
||||
end
|
||||
|
||||
#payment_settings
|
||||
#menu_item_attributes
|
||||
resources :menu_item_attributes
|
||||
#menu_item_options
|
||||
resources :menu_item_options
|
||||
#tax_profiles
|
||||
resources :tax_profiles
|
||||
#lookups
|
||||
resources :lookups
|
||||
#cashier_terminals
|
||||
resources :cashier_terminals
|
||||
#order_job_stations
|
||||
resources :order_job_stations
|
||||
#payment method settings
|
||||
resources :payment_method_settings
|
||||
#membership_settings
|
||||
resources :membership_settings
|
||||
#zones
|
||||
resources :zones do
|
||||
#tables
|
||||
resources :tables
|
||||
#rooms
|
||||
resources :rooms
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
159
spec/controllers/crm/customers_controller_spec.rb
Normal file
159
spec/controllers/crm/customers_controller_spec.rb
Normal file
@@ -0,0 +1,159 @@
|
||||
require 'rails_helper'
|
||||
|
||||
# This spec was generated by rspec-rails when you ran the scaffold generator.
|
||||
# It demonstrates how one might use RSpec to specify the controller code that
|
||||
# was generated by Rails when you ran the scaffold generator.
|
||||
#
|
||||
# It assumes that the implementation code is generated by the rails scaffold
|
||||
# generator. If you are using any extension libraries to generate different
|
||||
# controller code, this generated spec may or may not pass.
|
||||
#
|
||||
# It only uses APIs available in rails and/or rspec-rails. There are a number
|
||||
# of tools you can use to make these specs even more expressive, but we're
|
||||
# sticking to rails and rspec-rails APIs to keep things simple and stable.
|
||||
#
|
||||
# Compared to earlier versions of this generator, there is very limited use of
|
||||
# stubs and message expectations in this spec. Stubs are only used when there
|
||||
# is no simpler way to get a handle on the object needed for the example.
|
||||
# Message expectations are only used when there is no simpler way to specify
|
||||
# that an instance is receiving a specific message.
|
||||
|
||||
RSpec.describe Crm::CustomersController, type: :controller do
|
||||
|
||||
# This should return the minimal set of attributes required to create a valid
|
||||
# Crm::Customer. As you add validations to Crm::Customer, be sure to
|
||||
# adjust the attributes here as well.
|
||||
let(:valid_attributes) {
|
||||
skip("Add a hash of attributes valid for your model")
|
||||
}
|
||||
|
||||
let(:invalid_attributes) {
|
||||
skip("Add a hash of attributes invalid for your model")
|
||||
}
|
||||
|
||||
# This should return the minimal set of values that should be in the session
|
||||
# in order to pass any filters (e.g. authentication) defined in
|
||||
# Crm::CustomersController. Be sure to keep this updated too.
|
||||
let(:valid_session) { {} }
|
||||
|
||||
describe "GET #index" do
|
||||
it "assigns all crm_customers as @crm_customers" do
|
||||
customer = Crm::Customer.create! valid_attributes
|
||||
get :index, params: {}, session: valid_session
|
||||
expect(assigns(:crm_customers)).to eq([customer])
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #show" do
|
||||
it "assigns the requested crm_customer as @crm_customer" do
|
||||
customer = Crm::Customer.create! valid_attributes
|
||||
get :show, params: {id: customer.to_param}, session: valid_session
|
||||
expect(assigns(:crm_customer)).to eq(customer)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #new" do
|
||||
it "assigns a new crm_customer as @crm_customer" do
|
||||
get :new, params: {}, session: valid_session
|
||||
expect(assigns(:crm_customer)).to be_a_new(Crm::Customer)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #edit" do
|
||||
it "assigns the requested crm_customer as @crm_customer" do
|
||||
customer = Crm::Customer.create! valid_attributes
|
||||
get :edit, params: {id: customer.to_param}, session: valid_session
|
||||
expect(assigns(:crm_customer)).to eq(customer)
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST #create" do
|
||||
context "with valid params" do
|
||||
it "creates a new Crm::Customer" do
|
||||
expect {
|
||||
post :create, params: {crm_customer: valid_attributes}, session: valid_session
|
||||
}.to change(Crm::Customer, :count).by(1)
|
||||
end
|
||||
|
||||
it "assigns a newly created crm_customer as @crm_customer" do
|
||||
post :create, params: {crm_customer: valid_attributes}, session: valid_session
|
||||
expect(assigns(:crm_customer)).to be_a(Crm::Customer)
|
||||
expect(assigns(:crm_customer)).to be_persisted
|
||||
end
|
||||
|
||||
it "redirects to the created crm_customer" do
|
||||
post :create, params: {crm_customer: valid_attributes}, session: valid_session
|
||||
expect(response).to redirect_to(Crm::Customer.last)
|
||||
end
|
||||
end
|
||||
|
||||
context "with invalid params" do
|
||||
it "assigns a newly created but unsaved crm_customer as @crm_customer" do
|
||||
post :create, params: {crm_customer: invalid_attributes}, session: valid_session
|
||||
expect(assigns(:crm_customer)).to be_a_new(Crm::Customer)
|
||||
end
|
||||
|
||||
it "re-renders the 'new' template" do
|
||||
post :create, params: {crm_customer: invalid_attributes}, session: valid_session
|
||||
expect(response).to render_template("new")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT #update" do
|
||||
context "with valid params" do
|
||||
let(:new_attributes) {
|
||||
skip("Add a hash of attributes valid for your model")
|
||||
}
|
||||
|
||||
it "updates the requested crm_customer" do
|
||||
customer = Crm::Customer.create! valid_attributes
|
||||
put :update, params: {id: customer.to_param, crm_customer: new_attributes}, session: valid_session
|
||||
customer.reload
|
||||
skip("Add assertions for updated state")
|
||||
end
|
||||
|
||||
it "assigns the requested crm_customer as @crm_customer" do
|
||||
customer = Crm::Customer.create! valid_attributes
|
||||
put :update, params: {id: customer.to_param, crm_customer: valid_attributes}, session: valid_session
|
||||
expect(assigns(:crm_customer)).to eq(customer)
|
||||
end
|
||||
|
||||
it "redirects to the crm_customer" do
|
||||
customer = Crm::Customer.create! valid_attributes
|
||||
put :update, params: {id: customer.to_param, crm_customer: valid_attributes}, session: valid_session
|
||||
expect(response).to redirect_to(customer)
|
||||
end
|
||||
end
|
||||
|
||||
context "with invalid params" do
|
||||
it "assigns the crm_customer as @crm_customer" do
|
||||
customer = Crm::Customer.create! valid_attributes
|
||||
put :update, params: {id: customer.to_param, crm_customer: invalid_attributes}, session: valid_session
|
||||
expect(assigns(:crm_customer)).to eq(customer)
|
||||
end
|
||||
|
||||
it "re-renders the 'edit' template" do
|
||||
customer = Crm::Customer.create! valid_attributes
|
||||
put :update, params: {id: customer.to_param, crm_customer: invalid_attributes}, session: valid_session
|
||||
expect(response).to render_template("edit")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE #destroy" do
|
||||
it "destroys the requested crm_customer" do
|
||||
customer = Crm::Customer.create! valid_attributes
|
||||
expect {
|
||||
delete :destroy, params: {id: customer.to_param}, session: valid_session
|
||||
}.to change(Crm::Customer, :count).by(-1)
|
||||
end
|
||||
|
||||
it "redirects to the crm_customers list" do
|
||||
customer = Crm::Customer.create! valid_attributes
|
||||
delete :destroy, params: {id: customer.to_param}, session: valid_session
|
||||
expect(response).to redirect_to(crm_customers_url)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
159
spec/controllers/settings/cashier_terminals_controller_spec.rb
Normal file
159
spec/controllers/settings/cashier_terminals_controller_spec.rb
Normal file
@@ -0,0 +1,159 @@
|
||||
require 'rails_helper'
|
||||
|
||||
# This spec was generated by rspec-rails when you ran the scaffold generator.
|
||||
# It demonstrates how one might use RSpec to specify the controller code that
|
||||
# was generated by Rails when you ran the scaffold generator.
|
||||
#
|
||||
# It assumes that the implementation code is generated by the rails scaffold
|
||||
# generator. If you are using any extension libraries to generate different
|
||||
# controller code, this generated spec may or may not pass.
|
||||
#
|
||||
# It only uses APIs available in rails and/or rspec-rails. There are a number
|
||||
# of tools you can use to make these specs even more expressive, but we're
|
||||
# sticking to rails and rspec-rails APIs to keep things simple and stable.
|
||||
#
|
||||
# Compared to earlier versions of this generator, there is very limited use of
|
||||
# stubs and message expectations in this spec. Stubs are only used when there
|
||||
# is no simpler way to get a handle on the object needed for the example.
|
||||
# Message expectations are only used when there is no simpler way to specify
|
||||
# that an instance is receiving a specific message.
|
||||
|
||||
RSpec.describe Settings::CashierTerminalsController, type: :controller do
|
||||
|
||||
# This should return the minimal set of attributes required to create a valid
|
||||
# Settings::CashierTerminal. As you add validations to Settings::CashierTerminal, be sure to
|
||||
# adjust the attributes here as well.
|
||||
let(:valid_attributes) {
|
||||
skip("Add a hash of attributes valid for your model")
|
||||
}
|
||||
|
||||
let(:invalid_attributes) {
|
||||
skip("Add a hash of attributes invalid for your model")
|
||||
}
|
||||
|
||||
# This should return the minimal set of values that should be in the session
|
||||
# in order to pass any filters (e.g. authentication) defined in
|
||||
# Settings::CashierTerminalsController. Be sure to keep this updated too.
|
||||
let(:valid_session) { {} }
|
||||
|
||||
describe "GET #index" do
|
||||
it "assigns all settings_cashier_terminals as @settings_cashier_terminals" do
|
||||
cashier_terminal = Settings::CashierTerminal.create! valid_attributes
|
||||
get :index, params: {}, session: valid_session
|
||||
expect(assigns(:settings_cashier_terminals)).to eq([cashier_terminal])
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #show" do
|
||||
it "assigns the requested settings_cashier_terminal as @settings_cashier_terminal" do
|
||||
cashier_terminal = Settings::CashierTerminal.create! valid_attributes
|
||||
get :show, params: {id: cashier_terminal.to_param}, session: valid_session
|
||||
expect(assigns(:settings_cashier_terminal)).to eq(cashier_terminal)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #new" do
|
||||
it "assigns a new settings_cashier_terminal as @settings_cashier_terminal" do
|
||||
get :new, params: {}, session: valid_session
|
||||
expect(assigns(:settings_cashier_terminal)).to be_a_new(Settings::CashierTerminal)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #edit" do
|
||||
it "assigns the requested settings_cashier_terminal as @settings_cashier_terminal" do
|
||||
cashier_terminal = Settings::CashierTerminal.create! valid_attributes
|
||||
get :edit, params: {id: cashier_terminal.to_param}, session: valid_session
|
||||
expect(assigns(:settings_cashier_terminal)).to eq(cashier_terminal)
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST #create" do
|
||||
context "with valid params" do
|
||||
it "creates a new Settings::CashierTerminal" do
|
||||
expect {
|
||||
post :create, params: {settings_cashier_terminal: valid_attributes}, session: valid_session
|
||||
}.to change(Settings::CashierTerminal, :count).by(1)
|
||||
end
|
||||
|
||||
it "assigns a newly created settings_cashier_terminal as @settings_cashier_terminal" do
|
||||
post :create, params: {settings_cashier_terminal: valid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_cashier_terminal)).to be_a(Settings::CashierTerminal)
|
||||
expect(assigns(:settings_cashier_terminal)).to be_persisted
|
||||
end
|
||||
|
||||
it "redirects to the created settings_cashier_terminal" do
|
||||
post :create, params: {settings_cashier_terminal: valid_attributes}, session: valid_session
|
||||
expect(response).to redirect_to(Settings::CashierTerminal.last)
|
||||
end
|
||||
end
|
||||
|
||||
context "with invalid params" do
|
||||
it "assigns a newly created but unsaved settings_cashier_terminal as @settings_cashier_terminal" do
|
||||
post :create, params: {settings_cashier_terminal: invalid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_cashier_terminal)).to be_a_new(Settings::CashierTerminal)
|
||||
end
|
||||
|
||||
it "re-renders the 'new' template" do
|
||||
post :create, params: {settings_cashier_terminal: invalid_attributes}, session: valid_session
|
||||
expect(response).to render_template("new")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT #update" do
|
||||
context "with valid params" do
|
||||
let(:new_attributes) {
|
||||
skip("Add a hash of attributes valid for your model")
|
||||
}
|
||||
|
||||
it "updates the requested settings_cashier_terminal" do
|
||||
cashier_terminal = Settings::CashierTerminal.create! valid_attributes
|
||||
put :update, params: {id: cashier_terminal.to_param, settings_cashier_terminal: new_attributes}, session: valid_session
|
||||
cashier_terminal.reload
|
||||
skip("Add assertions for updated state")
|
||||
end
|
||||
|
||||
it "assigns the requested settings_cashier_terminal as @settings_cashier_terminal" do
|
||||
cashier_terminal = Settings::CashierTerminal.create! valid_attributes
|
||||
put :update, params: {id: cashier_terminal.to_param, settings_cashier_terminal: valid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_cashier_terminal)).to eq(cashier_terminal)
|
||||
end
|
||||
|
||||
it "redirects to the settings_cashier_terminal" do
|
||||
cashier_terminal = Settings::CashierTerminal.create! valid_attributes
|
||||
put :update, params: {id: cashier_terminal.to_param, settings_cashier_terminal: valid_attributes}, session: valid_session
|
||||
expect(response).to redirect_to(cashier_terminal)
|
||||
end
|
||||
end
|
||||
|
||||
context "with invalid params" do
|
||||
it "assigns the settings_cashier_terminal as @settings_cashier_terminal" do
|
||||
cashier_terminal = Settings::CashierTerminal.create! valid_attributes
|
||||
put :update, params: {id: cashier_terminal.to_param, settings_cashier_terminal: invalid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_cashier_terminal)).to eq(cashier_terminal)
|
||||
end
|
||||
|
||||
it "re-renders the 'edit' template" do
|
||||
cashier_terminal = Settings::CashierTerminal.create! valid_attributes
|
||||
put :update, params: {id: cashier_terminal.to_param, settings_cashier_terminal: invalid_attributes}, session: valid_session
|
||||
expect(response).to render_template("edit")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE #destroy" do
|
||||
it "destroys the requested settings_cashier_terminal" do
|
||||
cashier_terminal = Settings::CashierTerminal.create! valid_attributes
|
||||
expect {
|
||||
delete :destroy, params: {id: cashier_terminal.to_param}, session: valid_session
|
||||
}.to change(Settings::CashierTerminal, :count).by(-1)
|
||||
end
|
||||
|
||||
it "redirects to the settings_cashier_terminals list" do
|
||||
cashier_terminal = Settings::CashierTerminal.create! valid_attributes
|
||||
delete :destroy, params: {id: cashier_terminal.to_param}, session: valid_session
|
||||
expect(response).to redirect_to(settings_cashier_terminals_url)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
159
spec/controllers/settings/lookups_controller_spec.rb
Normal file
159
spec/controllers/settings/lookups_controller_spec.rb
Normal file
@@ -0,0 +1,159 @@
|
||||
require 'rails_helper'
|
||||
|
||||
# This spec was generated by rspec-rails when you ran the scaffold generator.
|
||||
# It demonstrates how one might use RSpec to specify the controller code that
|
||||
# was generated by Rails when you ran the scaffold generator.
|
||||
#
|
||||
# It assumes that the implementation code is generated by the rails scaffold
|
||||
# generator. If you are using any extension libraries to generate different
|
||||
# controller code, this generated spec may or may not pass.
|
||||
#
|
||||
# It only uses APIs available in rails and/or rspec-rails. There are a number
|
||||
# of tools you can use to make these specs even more expressive, but we're
|
||||
# sticking to rails and rspec-rails APIs to keep things simple and stable.
|
||||
#
|
||||
# Compared to earlier versions of this generator, there is very limited use of
|
||||
# stubs and message expectations in this spec. Stubs are only used when there
|
||||
# is no simpler way to get a handle on the object needed for the example.
|
||||
# Message expectations are only used when there is no simpler way to specify
|
||||
# that an instance is receiving a specific message.
|
||||
|
||||
RSpec.describe Settings::LookupsController, type: :controller do
|
||||
|
||||
# This should return the minimal set of attributes required to create a valid
|
||||
# Settings::Lookup. As you add validations to Settings::Lookup, be sure to
|
||||
# adjust the attributes here as well.
|
||||
let(:valid_attributes) {
|
||||
skip("Add a hash of attributes valid for your model")
|
||||
}
|
||||
|
||||
let(:invalid_attributes) {
|
||||
skip("Add a hash of attributes invalid for your model")
|
||||
}
|
||||
|
||||
# This should return the minimal set of values that should be in the session
|
||||
# in order to pass any filters (e.g. authentication) defined in
|
||||
# Settings::LookupsController. Be sure to keep this updated too.
|
||||
let(:valid_session) { {} }
|
||||
|
||||
describe "GET #index" do
|
||||
it "assigns all settings_lookups as @settings_lookups" do
|
||||
lookup = Settings::Lookup.create! valid_attributes
|
||||
get :index, params: {}, session: valid_session
|
||||
expect(assigns(:settings_lookups)).to eq([lookup])
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #show" do
|
||||
it "assigns the requested settings_lookup as @settings_lookup" do
|
||||
lookup = Settings::Lookup.create! valid_attributes
|
||||
get :show, params: {id: lookup.to_param}, session: valid_session
|
||||
expect(assigns(:settings_lookup)).to eq(lookup)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #new" do
|
||||
it "assigns a new settings_lookup as @settings_lookup" do
|
||||
get :new, params: {}, session: valid_session
|
||||
expect(assigns(:settings_lookup)).to be_a_new(Settings::Lookup)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #edit" do
|
||||
it "assigns the requested settings_lookup as @settings_lookup" do
|
||||
lookup = Settings::Lookup.create! valid_attributes
|
||||
get :edit, params: {id: lookup.to_param}, session: valid_session
|
||||
expect(assigns(:settings_lookup)).to eq(lookup)
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST #create" do
|
||||
context "with valid params" do
|
||||
it "creates a new Settings::Lookup" do
|
||||
expect {
|
||||
post :create, params: {settings_lookup: valid_attributes}, session: valid_session
|
||||
}.to change(Settings::Lookup, :count).by(1)
|
||||
end
|
||||
|
||||
it "assigns a newly created settings_lookup as @settings_lookup" do
|
||||
post :create, params: {settings_lookup: valid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_lookup)).to be_a(Settings::Lookup)
|
||||
expect(assigns(:settings_lookup)).to be_persisted
|
||||
end
|
||||
|
||||
it "redirects to the created settings_lookup" do
|
||||
post :create, params: {settings_lookup: valid_attributes}, session: valid_session
|
||||
expect(response).to redirect_to(Settings::Lookup.last)
|
||||
end
|
||||
end
|
||||
|
||||
context "with invalid params" do
|
||||
it "assigns a newly created but unsaved settings_lookup as @settings_lookup" do
|
||||
post :create, params: {settings_lookup: invalid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_lookup)).to be_a_new(Settings::Lookup)
|
||||
end
|
||||
|
||||
it "re-renders the 'new' template" do
|
||||
post :create, params: {settings_lookup: invalid_attributes}, session: valid_session
|
||||
expect(response).to render_template("new")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT #update" do
|
||||
context "with valid params" do
|
||||
let(:new_attributes) {
|
||||
skip("Add a hash of attributes valid for your model")
|
||||
}
|
||||
|
||||
it "updates the requested settings_lookup" do
|
||||
lookup = Settings::Lookup.create! valid_attributes
|
||||
put :update, params: {id: lookup.to_param, settings_lookup: new_attributes}, session: valid_session
|
||||
lookup.reload
|
||||
skip("Add assertions for updated state")
|
||||
end
|
||||
|
||||
it "assigns the requested settings_lookup as @settings_lookup" do
|
||||
lookup = Settings::Lookup.create! valid_attributes
|
||||
put :update, params: {id: lookup.to_param, settings_lookup: valid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_lookup)).to eq(lookup)
|
||||
end
|
||||
|
||||
it "redirects to the settings_lookup" do
|
||||
lookup = Settings::Lookup.create! valid_attributes
|
||||
put :update, params: {id: lookup.to_param, settings_lookup: valid_attributes}, session: valid_session
|
||||
expect(response).to redirect_to(lookup)
|
||||
end
|
||||
end
|
||||
|
||||
context "with invalid params" do
|
||||
it "assigns the settings_lookup as @settings_lookup" do
|
||||
lookup = Settings::Lookup.create! valid_attributes
|
||||
put :update, params: {id: lookup.to_param, settings_lookup: invalid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_lookup)).to eq(lookup)
|
||||
end
|
||||
|
||||
it "re-renders the 'edit' template" do
|
||||
lookup = Settings::Lookup.create! valid_attributes
|
||||
put :update, params: {id: lookup.to_param, settings_lookup: invalid_attributes}, session: valid_session
|
||||
expect(response).to render_template("edit")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE #destroy" do
|
||||
it "destroys the requested settings_lookup" do
|
||||
lookup = Settings::Lookup.create! valid_attributes
|
||||
expect {
|
||||
delete :destroy, params: {id: lookup.to_param}, session: valid_session
|
||||
}.to change(Settings::Lookup, :count).by(-1)
|
||||
end
|
||||
|
||||
it "redirects to the settings_lookups list" do
|
||||
lookup = Settings::Lookup.create! valid_attributes
|
||||
delete :destroy, params: {id: lookup.to_param}, session: valid_session
|
||||
expect(response).to redirect_to(settings_lookups_url)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
159
spec/controllers/settings/membership_settings_controller_spec.rb
Normal file
159
spec/controllers/settings/membership_settings_controller_spec.rb
Normal file
@@ -0,0 +1,159 @@
|
||||
require 'rails_helper'
|
||||
|
||||
# This spec was generated by rspec-rails when you ran the scaffold generator.
|
||||
# It demonstrates how one might use RSpec to specify the controller code that
|
||||
# was generated by Rails when you ran the scaffold generator.
|
||||
#
|
||||
# It assumes that the implementation code is generated by the rails scaffold
|
||||
# generator. If you are using any extension libraries to generate different
|
||||
# controller code, this generated spec may or may not pass.
|
||||
#
|
||||
# It only uses APIs available in rails and/or rspec-rails. There are a number
|
||||
# of tools you can use to make these specs even more expressive, but we're
|
||||
# sticking to rails and rspec-rails APIs to keep things simple and stable.
|
||||
#
|
||||
# Compared to earlier versions of this generator, there is very limited use of
|
||||
# stubs and message expectations in this spec. Stubs are only used when there
|
||||
# is no simpler way to get a handle on the object needed for the example.
|
||||
# Message expectations are only used when there is no simpler way to specify
|
||||
# that an instance is receiving a specific message.
|
||||
|
||||
RSpec.describe Settings::MembershipSettingsController, type: :controller do
|
||||
|
||||
# This should return the minimal set of attributes required to create a valid
|
||||
# Settings::MembershipSetting. As you add validations to Settings::MembershipSetting, be sure to
|
||||
# adjust the attributes here as well.
|
||||
let(:valid_attributes) {
|
||||
skip("Add a hash of attributes valid for your model")
|
||||
}
|
||||
|
||||
let(:invalid_attributes) {
|
||||
skip("Add a hash of attributes invalid for your model")
|
||||
}
|
||||
|
||||
# This should return the minimal set of values that should be in the session
|
||||
# in order to pass any filters (e.g. authentication) defined in
|
||||
# Settings::MembershipSettingsController. Be sure to keep this updated too.
|
||||
let(:valid_session) { {} }
|
||||
|
||||
describe "GET #index" do
|
||||
it "assigns all settings_membership_settings as @settings_membership_settings" do
|
||||
membership_setting = Settings::MembershipSetting.create! valid_attributes
|
||||
get :index, params: {}, session: valid_session
|
||||
expect(assigns(:settings_membership_settings)).to eq([membership_setting])
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #show" do
|
||||
it "assigns the requested settings_membership_setting as @settings_membership_setting" do
|
||||
membership_setting = Settings::MembershipSetting.create! valid_attributes
|
||||
get :show, params: {id: membership_setting.to_param}, session: valid_session
|
||||
expect(assigns(:settings_membership_setting)).to eq(membership_setting)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #new" do
|
||||
it "assigns a new settings_membership_setting as @settings_membership_setting" do
|
||||
get :new, params: {}, session: valid_session
|
||||
expect(assigns(:settings_membership_setting)).to be_a_new(Settings::MembershipSetting)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #edit" do
|
||||
it "assigns the requested settings_membership_setting as @settings_membership_setting" do
|
||||
membership_setting = Settings::MembershipSetting.create! valid_attributes
|
||||
get :edit, params: {id: membership_setting.to_param}, session: valid_session
|
||||
expect(assigns(:settings_membership_setting)).to eq(membership_setting)
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST #create" do
|
||||
context "with valid params" do
|
||||
it "creates a new Settings::MembershipSetting" do
|
||||
expect {
|
||||
post :create, params: {settings_membership_setting: valid_attributes}, session: valid_session
|
||||
}.to change(Settings::MembershipSetting, :count).by(1)
|
||||
end
|
||||
|
||||
it "assigns a newly created settings_membership_setting as @settings_membership_setting" do
|
||||
post :create, params: {settings_membership_setting: valid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_membership_setting)).to be_a(Settings::MembershipSetting)
|
||||
expect(assigns(:settings_membership_setting)).to be_persisted
|
||||
end
|
||||
|
||||
it "redirects to the created settings_membership_setting" do
|
||||
post :create, params: {settings_membership_setting: valid_attributes}, session: valid_session
|
||||
expect(response).to redirect_to(Settings::MembershipSetting.last)
|
||||
end
|
||||
end
|
||||
|
||||
context "with invalid params" do
|
||||
it "assigns a newly created but unsaved settings_membership_setting as @settings_membership_setting" do
|
||||
post :create, params: {settings_membership_setting: invalid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_membership_setting)).to be_a_new(Settings::MembershipSetting)
|
||||
end
|
||||
|
||||
it "re-renders the 'new' template" do
|
||||
post :create, params: {settings_membership_setting: invalid_attributes}, session: valid_session
|
||||
expect(response).to render_template("new")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT #update" do
|
||||
context "with valid params" do
|
||||
let(:new_attributes) {
|
||||
skip("Add a hash of attributes valid for your model")
|
||||
}
|
||||
|
||||
it "updates the requested settings_membership_setting" do
|
||||
membership_setting = Settings::MembershipSetting.create! valid_attributes
|
||||
put :update, params: {id: membership_setting.to_param, settings_membership_setting: new_attributes}, session: valid_session
|
||||
membership_setting.reload
|
||||
skip("Add assertions for updated state")
|
||||
end
|
||||
|
||||
it "assigns the requested settings_membership_setting as @settings_membership_setting" do
|
||||
membership_setting = Settings::MembershipSetting.create! valid_attributes
|
||||
put :update, params: {id: membership_setting.to_param, settings_membership_setting: valid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_membership_setting)).to eq(membership_setting)
|
||||
end
|
||||
|
||||
it "redirects to the settings_membership_setting" do
|
||||
membership_setting = Settings::MembershipSetting.create! valid_attributes
|
||||
put :update, params: {id: membership_setting.to_param, settings_membership_setting: valid_attributes}, session: valid_session
|
||||
expect(response).to redirect_to(membership_setting)
|
||||
end
|
||||
end
|
||||
|
||||
context "with invalid params" do
|
||||
it "assigns the settings_membership_setting as @settings_membership_setting" do
|
||||
membership_setting = Settings::MembershipSetting.create! valid_attributes
|
||||
put :update, params: {id: membership_setting.to_param, settings_membership_setting: invalid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_membership_setting)).to eq(membership_setting)
|
||||
end
|
||||
|
||||
it "re-renders the 'edit' template" do
|
||||
membership_setting = Settings::MembershipSetting.create! valid_attributes
|
||||
put :update, params: {id: membership_setting.to_param, settings_membership_setting: invalid_attributes}, session: valid_session
|
||||
expect(response).to render_template("edit")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE #destroy" do
|
||||
it "destroys the requested settings_membership_setting" do
|
||||
membership_setting = Settings::MembershipSetting.create! valid_attributes
|
||||
expect {
|
||||
delete :destroy, params: {id: membership_setting.to_param}, session: valid_session
|
||||
}.to change(Settings::MembershipSetting, :count).by(-1)
|
||||
end
|
||||
|
||||
it "redirects to the settings_membership_settings list" do
|
||||
membership_setting = Settings::MembershipSetting.create! valid_attributes
|
||||
delete :destroy, params: {id: membership_setting.to_param}, session: valid_session
|
||||
expect(response).to redirect_to(settings_membership_settings_url)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,159 @@
|
||||
require 'rails_helper'
|
||||
|
||||
# This spec was generated by rspec-rails when you ran the scaffold generator.
|
||||
# It demonstrates how one might use RSpec to specify the controller code that
|
||||
# was generated by Rails when you ran the scaffold generator.
|
||||
#
|
||||
# It assumes that the implementation code is generated by the rails scaffold
|
||||
# generator. If you are using any extension libraries to generate different
|
||||
# controller code, this generated spec may or may not pass.
|
||||
#
|
||||
# It only uses APIs available in rails and/or rspec-rails. There are a number
|
||||
# of tools you can use to make these specs even more expressive, but we're
|
||||
# sticking to rails and rspec-rails APIs to keep things simple and stable.
|
||||
#
|
||||
# Compared to earlier versions of this generator, there is very limited use of
|
||||
# stubs and message expectations in this spec. Stubs are only used when there
|
||||
# is no simpler way to get a handle on the object needed for the example.
|
||||
# Message expectations are only used when there is no simpler way to specify
|
||||
# that an instance is receiving a specific message.
|
||||
|
||||
RSpec.describe Settings::MenuItemAttributesController, type: :controller do
|
||||
|
||||
# This should return the minimal set of attributes required to create a valid
|
||||
# Settings::MenuItemAttribute. As you add validations to Settings::MenuItemAttribute, be sure to
|
||||
# adjust the attributes here as well.
|
||||
let(:valid_attributes) {
|
||||
skip("Add a hash of attributes valid for your model")
|
||||
}
|
||||
|
||||
let(:invalid_attributes) {
|
||||
skip("Add a hash of attributes invalid for your model")
|
||||
}
|
||||
|
||||
# This should return the minimal set of values that should be in the session
|
||||
# in order to pass any filters (e.g. authentication) defined in
|
||||
# Settings::MenuItemAttributesController. Be sure to keep this updated too.
|
||||
let(:valid_session) { {} }
|
||||
|
||||
describe "GET #index" do
|
||||
it "assigns all settings_menu_item_attributes as @settings_menu_item_attributes" do
|
||||
menu_item_attribute = Settings::MenuItemAttribute.create! valid_attributes
|
||||
get :index, params: {}, session: valid_session
|
||||
expect(assigns(:settings_menu_item_attributes)).to eq([menu_item_attribute])
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #show" do
|
||||
it "assigns the requested settings_menu_item_attribute as @settings_menu_item_attribute" do
|
||||
menu_item_attribute = Settings::MenuItemAttribute.create! valid_attributes
|
||||
get :show, params: {id: menu_item_attribute.to_param}, session: valid_session
|
||||
expect(assigns(:settings_menu_item_attribute)).to eq(menu_item_attribute)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #new" do
|
||||
it "assigns a new settings_menu_item_attribute as @settings_menu_item_attribute" do
|
||||
get :new, params: {}, session: valid_session
|
||||
expect(assigns(:settings_menu_item_attribute)).to be_a_new(Settings::MenuItemAttribute)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #edit" do
|
||||
it "assigns the requested settings_menu_item_attribute as @settings_menu_item_attribute" do
|
||||
menu_item_attribute = Settings::MenuItemAttribute.create! valid_attributes
|
||||
get :edit, params: {id: menu_item_attribute.to_param}, session: valid_session
|
||||
expect(assigns(:settings_menu_item_attribute)).to eq(menu_item_attribute)
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST #create" do
|
||||
context "with valid params" do
|
||||
it "creates a new Settings::MenuItemAttribute" do
|
||||
expect {
|
||||
post :create, params: {settings_menu_item_attribute: valid_attributes}, session: valid_session
|
||||
}.to change(Settings::MenuItemAttribute, :count).by(1)
|
||||
end
|
||||
|
||||
it "assigns a newly created settings_menu_item_attribute as @settings_menu_item_attribute" do
|
||||
post :create, params: {settings_menu_item_attribute: valid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_menu_item_attribute)).to be_a(Settings::MenuItemAttribute)
|
||||
expect(assigns(:settings_menu_item_attribute)).to be_persisted
|
||||
end
|
||||
|
||||
it "redirects to the created settings_menu_item_attribute" do
|
||||
post :create, params: {settings_menu_item_attribute: valid_attributes}, session: valid_session
|
||||
expect(response).to redirect_to(Settings::MenuItemAttribute.last)
|
||||
end
|
||||
end
|
||||
|
||||
context "with invalid params" do
|
||||
it "assigns a newly created but unsaved settings_menu_item_attribute as @settings_menu_item_attribute" do
|
||||
post :create, params: {settings_menu_item_attribute: invalid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_menu_item_attribute)).to be_a_new(Settings::MenuItemAttribute)
|
||||
end
|
||||
|
||||
it "re-renders the 'new' template" do
|
||||
post :create, params: {settings_menu_item_attribute: invalid_attributes}, session: valid_session
|
||||
expect(response).to render_template("new")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT #update" do
|
||||
context "with valid params" do
|
||||
let(:new_attributes) {
|
||||
skip("Add a hash of attributes valid for your model")
|
||||
}
|
||||
|
||||
it "updates the requested settings_menu_item_attribute" do
|
||||
menu_item_attribute = Settings::MenuItemAttribute.create! valid_attributes
|
||||
put :update, params: {id: menu_item_attribute.to_param, settings_menu_item_attribute: new_attributes}, session: valid_session
|
||||
menu_item_attribute.reload
|
||||
skip("Add assertions for updated state")
|
||||
end
|
||||
|
||||
it "assigns the requested settings_menu_item_attribute as @settings_menu_item_attribute" do
|
||||
menu_item_attribute = Settings::MenuItemAttribute.create! valid_attributes
|
||||
put :update, params: {id: menu_item_attribute.to_param, settings_menu_item_attribute: valid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_menu_item_attribute)).to eq(menu_item_attribute)
|
||||
end
|
||||
|
||||
it "redirects to the settings_menu_item_attribute" do
|
||||
menu_item_attribute = Settings::MenuItemAttribute.create! valid_attributes
|
||||
put :update, params: {id: menu_item_attribute.to_param, settings_menu_item_attribute: valid_attributes}, session: valid_session
|
||||
expect(response).to redirect_to(menu_item_attribute)
|
||||
end
|
||||
end
|
||||
|
||||
context "with invalid params" do
|
||||
it "assigns the settings_menu_item_attribute as @settings_menu_item_attribute" do
|
||||
menu_item_attribute = Settings::MenuItemAttribute.create! valid_attributes
|
||||
put :update, params: {id: menu_item_attribute.to_param, settings_menu_item_attribute: invalid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_menu_item_attribute)).to eq(menu_item_attribute)
|
||||
end
|
||||
|
||||
it "re-renders the 'edit' template" do
|
||||
menu_item_attribute = Settings::MenuItemAttribute.create! valid_attributes
|
||||
put :update, params: {id: menu_item_attribute.to_param, settings_menu_item_attribute: invalid_attributes}, session: valid_session
|
||||
expect(response).to render_template("edit")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE #destroy" do
|
||||
it "destroys the requested settings_menu_item_attribute" do
|
||||
menu_item_attribute = Settings::MenuItemAttribute.create! valid_attributes
|
||||
expect {
|
||||
delete :destroy, params: {id: menu_item_attribute.to_param}, session: valid_session
|
||||
}.to change(Settings::MenuItemAttribute, :count).by(-1)
|
||||
end
|
||||
|
||||
it "redirects to the settings_menu_item_attributes list" do
|
||||
menu_item_attribute = Settings::MenuItemAttribute.create! valid_attributes
|
||||
delete :destroy, params: {id: menu_item_attribute.to_param}, session: valid_session
|
||||
expect(response).to redirect_to(settings_menu_item_attributes_url)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
159
spec/controllers/settings/menu_item_options_controller_spec.rb
Normal file
159
spec/controllers/settings/menu_item_options_controller_spec.rb
Normal file
@@ -0,0 +1,159 @@
|
||||
require 'rails_helper'
|
||||
|
||||
# This spec was generated by rspec-rails when you ran the scaffold generator.
|
||||
# It demonstrates how one might use RSpec to specify the controller code that
|
||||
# was generated by Rails when you ran the scaffold generator.
|
||||
#
|
||||
# It assumes that the implementation code is generated by the rails scaffold
|
||||
# generator. If you are using any extension libraries to generate different
|
||||
# controller code, this generated spec may or may not pass.
|
||||
#
|
||||
# It only uses APIs available in rails and/or rspec-rails. There are a number
|
||||
# of tools you can use to make these specs even more expressive, but we're
|
||||
# sticking to rails and rspec-rails APIs to keep things simple and stable.
|
||||
#
|
||||
# Compared to earlier versions of this generator, there is very limited use of
|
||||
# stubs and message expectations in this spec. Stubs are only used when there
|
||||
# is no simpler way to get a handle on the object needed for the example.
|
||||
# Message expectations are only used when there is no simpler way to specify
|
||||
# that an instance is receiving a specific message.
|
||||
|
||||
RSpec.describe Settings::MenuItemOptionsController, type: :controller do
|
||||
|
||||
# This should return the minimal set of attributes required to create a valid
|
||||
# Settings::MenuItemOption. As you add validations to Settings::MenuItemOption, be sure to
|
||||
# adjust the attributes here as well.
|
||||
let(:valid_attributes) {
|
||||
skip("Add a hash of attributes valid for your model")
|
||||
}
|
||||
|
||||
let(:invalid_attributes) {
|
||||
skip("Add a hash of attributes invalid for your model")
|
||||
}
|
||||
|
||||
# This should return the minimal set of values that should be in the session
|
||||
# in order to pass any filters (e.g. authentication) defined in
|
||||
# Settings::MenuItemOptionsController. Be sure to keep this updated too.
|
||||
let(:valid_session) { {} }
|
||||
|
||||
describe "GET #index" do
|
||||
it "assigns all settings_menu_item_options as @settings_menu_item_options" do
|
||||
menu_item_option = Settings::MenuItemOption.create! valid_attributes
|
||||
get :index, params: {}, session: valid_session
|
||||
expect(assigns(:settings_menu_item_options)).to eq([menu_item_option])
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #show" do
|
||||
it "assigns the requested settings_menu_item_option as @settings_menu_item_option" do
|
||||
menu_item_option = Settings::MenuItemOption.create! valid_attributes
|
||||
get :show, params: {id: menu_item_option.to_param}, session: valid_session
|
||||
expect(assigns(:settings_menu_item_option)).to eq(menu_item_option)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #new" do
|
||||
it "assigns a new settings_menu_item_option as @settings_menu_item_option" do
|
||||
get :new, params: {}, session: valid_session
|
||||
expect(assigns(:settings_menu_item_option)).to be_a_new(Settings::MenuItemOption)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #edit" do
|
||||
it "assigns the requested settings_menu_item_option as @settings_menu_item_option" do
|
||||
menu_item_option = Settings::MenuItemOption.create! valid_attributes
|
||||
get :edit, params: {id: menu_item_option.to_param}, session: valid_session
|
||||
expect(assigns(:settings_menu_item_option)).to eq(menu_item_option)
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST #create" do
|
||||
context "with valid params" do
|
||||
it "creates a new Settings::MenuItemOption" do
|
||||
expect {
|
||||
post :create, params: {settings_menu_item_option: valid_attributes}, session: valid_session
|
||||
}.to change(Settings::MenuItemOption, :count).by(1)
|
||||
end
|
||||
|
||||
it "assigns a newly created settings_menu_item_option as @settings_menu_item_option" do
|
||||
post :create, params: {settings_menu_item_option: valid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_menu_item_option)).to be_a(Settings::MenuItemOption)
|
||||
expect(assigns(:settings_menu_item_option)).to be_persisted
|
||||
end
|
||||
|
||||
it "redirects to the created settings_menu_item_option" do
|
||||
post :create, params: {settings_menu_item_option: valid_attributes}, session: valid_session
|
||||
expect(response).to redirect_to(Settings::MenuItemOption.last)
|
||||
end
|
||||
end
|
||||
|
||||
context "with invalid params" do
|
||||
it "assigns a newly created but unsaved settings_menu_item_option as @settings_menu_item_option" do
|
||||
post :create, params: {settings_menu_item_option: invalid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_menu_item_option)).to be_a_new(Settings::MenuItemOption)
|
||||
end
|
||||
|
||||
it "re-renders the 'new' template" do
|
||||
post :create, params: {settings_menu_item_option: invalid_attributes}, session: valid_session
|
||||
expect(response).to render_template("new")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT #update" do
|
||||
context "with valid params" do
|
||||
let(:new_attributes) {
|
||||
skip("Add a hash of attributes valid for your model")
|
||||
}
|
||||
|
||||
it "updates the requested settings_menu_item_option" do
|
||||
menu_item_option = Settings::MenuItemOption.create! valid_attributes
|
||||
put :update, params: {id: menu_item_option.to_param, settings_menu_item_option: new_attributes}, session: valid_session
|
||||
menu_item_option.reload
|
||||
skip("Add assertions for updated state")
|
||||
end
|
||||
|
||||
it "assigns the requested settings_menu_item_option as @settings_menu_item_option" do
|
||||
menu_item_option = Settings::MenuItemOption.create! valid_attributes
|
||||
put :update, params: {id: menu_item_option.to_param, settings_menu_item_option: valid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_menu_item_option)).to eq(menu_item_option)
|
||||
end
|
||||
|
||||
it "redirects to the settings_menu_item_option" do
|
||||
menu_item_option = Settings::MenuItemOption.create! valid_attributes
|
||||
put :update, params: {id: menu_item_option.to_param, settings_menu_item_option: valid_attributes}, session: valid_session
|
||||
expect(response).to redirect_to(menu_item_option)
|
||||
end
|
||||
end
|
||||
|
||||
context "with invalid params" do
|
||||
it "assigns the settings_menu_item_option as @settings_menu_item_option" do
|
||||
menu_item_option = Settings::MenuItemOption.create! valid_attributes
|
||||
put :update, params: {id: menu_item_option.to_param, settings_menu_item_option: invalid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_menu_item_option)).to eq(menu_item_option)
|
||||
end
|
||||
|
||||
it "re-renders the 'edit' template" do
|
||||
menu_item_option = Settings::MenuItemOption.create! valid_attributes
|
||||
put :update, params: {id: menu_item_option.to_param, settings_menu_item_option: invalid_attributes}, session: valid_session
|
||||
expect(response).to render_template("edit")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE #destroy" do
|
||||
it "destroys the requested settings_menu_item_option" do
|
||||
menu_item_option = Settings::MenuItemOption.create! valid_attributes
|
||||
expect {
|
||||
delete :destroy, params: {id: menu_item_option.to_param}, session: valid_session
|
||||
}.to change(Settings::MenuItemOption, :count).by(-1)
|
||||
end
|
||||
|
||||
it "redirects to the settings_menu_item_options list" do
|
||||
menu_item_option = Settings::MenuItemOption.create! valid_attributes
|
||||
delete :destroy, params: {id: menu_item_option.to_param}, session: valid_session
|
||||
expect(response).to redirect_to(settings_menu_item_options_url)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,159 @@
|
||||
require 'rails_helper'
|
||||
|
||||
# This spec was generated by rspec-rails when you ran the scaffold generator.
|
||||
# It demonstrates how one might use RSpec to specify the controller code that
|
||||
# was generated by Rails when you ran the scaffold generator.
|
||||
#
|
||||
# It assumes that the implementation code is generated by the rails scaffold
|
||||
# generator. If you are using any extension libraries to generate different
|
||||
# controller code, this generated spec may or may not pass.
|
||||
#
|
||||
# It only uses APIs available in rails and/or rspec-rails. There are a number
|
||||
# of tools you can use to make these specs even more expressive, but we're
|
||||
# sticking to rails and rspec-rails APIs to keep things simple and stable.
|
||||
#
|
||||
# Compared to earlier versions of this generator, there is very limited use of
|
||||
# stubs and message expectations in this spec. Stubs are only used when there
|
||||
# is no simpler way to get a handle on the object needed for the example.
|
||||
# Message expectations are only used when there is no simpler way to specify
|
||||
# that an instance is receiving a specific message.
|
||||
|
||||
RSpec.describe Settings::PaymentMethodSettingsController, type: :controller do
|
||||
|
||||
# This should return the minimal set of attributes required to create a valid
|
||||
# Settings::PaymentMethodSetting. As you add validations to Settings::PaymentMethodSetting, be sure to
|
||||
# adjust the attributes here as well.
|
||||
let(:valid_attributes) {
|
||||
skip("Add a hash of attributes valid for your model")
|
||||
}
|
||||
|
||||
let(:invalid_attributes) {
|
||||
skip("Add a hash of attributes invalid for your model")
|
||||
}
|
||||
|
||||
# This should return the minimal set of values that should be in the session
|
||||
# in order to pass any filters (e.g. authentication) defined in
|
||||
# Settings::PaymentMethodSettingsController. Be sure to keep this updated too.
|
||||
let(:valid_session) { {} }
|
||||
|
||||
describe "GET #index" do
|
||||
it "assigns all settings_payment_method_settings as @settings_payment_method_settings" do
|
||||
payment_method_setting = Settings::PaymentMethodSetting.create! valid_attributes
|
||||
get :index, params: {}, session: valid_session
|
||||
expect(assigns(:settings_payment_method_settings)).to eq([payment_method_setting])
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #show" do
|
||||
it "assigns the requested settings_payment_method_setting as @settings_payment_method_setting" do
|
||||
payment_method_setting = Settings::PaymentMethodSetting.create! valid_attributes
|
||||
get :show, params: {id: payment_method_setting.to_param}, session: valid_session
|
||||
expect(assigns(:settings_payment_method_setting)).to eq(payment_method_setting)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #new" do
|
||||
it "assigns a new settings_payment_method_setting as @settings_payment_method_setting" do
|
||||
get :new, params: {}, session: valid_session
|
||||
expect(assigns(:settings_payment_method_setting)).to be_a_new(Settings::PaymentMethodSetting)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #edit" do
|
||||
it "assigns the requested settings_payment_method_setting as @settings_payment_method_setting" do
|
||||
payment_method_setting = Settings::PaymentMethodSetting.create! valid_attributes
|
||||
get :edit, params: {id: payment_method_setting.to_param}, session: valid_session
|
||||
expect(assigns(:settings_payment_method_setting)).to eq(payment_method_setting)
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST #create" do
|
||||
context "with valid params" do
|
||||
it "creates a new Settings::PaymentMethodSetting" do
|
||||
expect {
|
||||
post :create, params: {settings_payment_method_setting: valid_attributes}, session: valid_session
|
||||
}.to change(Settings::PaymentMethodSetting, :count).by(1)
|
||||
end
|
||||
|
||||
it "assigns a newly created settings_payment_method_setting as @settings_payment_method_setting" do
|
||||
post :create, params: {settings_payment_method_setting: valid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_payment_method_setting)).to be_a(Settings::PaymentMethodSetting)
|
||||
expect(assigns(:settings_payment_method_setting)).to be_persisted
|
||||
end
|
||||
|
||||
it "redirects to the created settings_payment_method_setting" do
|
||||
post :create, params: {settings_payment_method_setting: valid_attributes}, session: valid_session
|
||||
expect(response).to redirect_to(Settings::PaymentMethodSetting.last)
|
||||
end
|
||||
end
|
||||
|
||||
context "with invalid params" do
|
||||
it "assigns a newly created but unsaved settings_payment_method_setting as @settings_payment_method_setting" do
|
||||
post :create, params: {settings_payment_method_setting: invalid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_payment_method_setting)).to be_a_new(Settings::PaymentMethodSetting)
|
||||
end
|
||||
|
||||
it "re-renders the 'new' template" do
|
||||
post :create, params: {settings_payment_method_setting: invalid_attributes}, session: valid_session
|
||||
expect(response).to render_template("new")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT #update" do
|
||||
context "with valid params" do
|
||||
let(:new_attributes) {
|
||||
skip("Add a hash of attributes valid for your model")
|
||||
}
|
||||
|
||||
it "updates the requested settings_payment_method_setting" do
|
||||
payment_method_setting = Settings::PaymentMethodSetting.create! valid_attributes
|
||||
put :update, params: {id: payment_method_setting.to_param, settings_payment_method_setting: new_attributes}, session: valid_session
|
||||
payment_method_setting.reload
|
||||
skip("Add assertions for updated state")
|
||||
end
|
||||
|
||||
it "assigns the requested settings_payment_method_setting as @settings_payment_method_setting" do
|
||||
payment_method_setting = Settings::PaymentMethodSetting.create! valid_attributes
|
||||
put :update, params: {id: payment_method_setting.to_param, settings_payment_method_setting: valid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_payment_method_setting)).to eq(payment_method_setting)
|
||||
end
|
||||
|
||||
it "redirects to the settings_payment_method_setting" do
|
||||
payment_method_setting = Settings::PaymentMethodSetting.create! valid_attributes
|
||||
put :update, params: {id: payment_method_setting.to_param, settings_payment_method_setting: valid_attributes}, session: valid_session
|
||||
expect(response).to redirect_to(payment_method_setting)
|
||||
end
|
||||
end
|
||||
|
||||
context "with invalid params" do
|
||||
it "assigns the settings_payment_method_setting as @settings_payment_method_setting" do
|
||||
payment_method_setting = Settings::PaymentMethodSetting.create! valid_attributes
|
||||
put :update, params: {id: payment_method_setting.to_param, settings_payment_method_setting: invalid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_payment_method_setting)).to eq(payment_method_setting)
|
||||
end
|
||||
|
||||
it "re-renders the 'edit' template" do
|
||||
payment_method_setting = Settings::PaymentMethodSetting.create! valid_attributes
|
||||
put :update, params: {id: payment_method_setting.to_param, settings_payment_method_setting: invalid_attributes}, session: valid_session
|
||||
expect(response).to render_template("edit")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE #destroy" do
|
||||
it "destroys the requested settings_payment_method_setting" do
|
||||
payment_method_setting = Settings::PaymentMethodSetting.create! valid_attributes
|
||||
expect {
|
||||
delete :destroy, params: {id: payment_method_setting.to_param}, session: valid_session
|
||||
}.to change(Settings::PaymentMethodSetting, :count).by(-1)
|
||||
end
|
||||
|
||||
it "redirects to the settings_payment_method_settings list" do
|
||||
payment_method_setting = Settings::PaymentMethodSetting.create! valid_attributes
|
||||
delete :destroy, params: {id: payment_method_setting.to_param}, session: valid_session
|
||||
expect(response).to redirect_to(settings_payment_method_settings_url)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
159
spec/controllers/settings/zones_controller_spec.rb
Normal file
159
spec/controllers/settings/zones_controller_spec.rb
Normal file
@@ -0,0 +1,159 @@
|
||||
require 'rails_helper'
|
||||
|
||||
# This spec was generated by rspec-rails when you ran the scaffold generator.
|
||||
# It demonstrates how one might use RSpec to specify the controller code that
|
||||
# was generated by Rails when you ran the scaffold generator.
|
||||
#
|
||||
# It assumes that the implementation code is generated by the rails scaffold
|
||||
# generator. If you are using any extension libraries to generate different
|
||||
# controller code, this generated spec may or may not pass.
|
||||
#
|
||||
# It only uses APIs available in rails and/or rspec-rails. There are a number
|
||||
# of tools you can use to make these specs even more expressive, but we're
|
||||
# sticking to rails and rspec-rails APIs to keep things simple and stable.
|
||||
#
|
||||
# Compared to earlier versions of this generator, there is very limited use of
|
||||
# stubs and message expectations in this spec. Stubs are only used when there
|
||||
# is no simpler way to get a handle on the object needed for the example.
|
||||
# Message expectations are only used when there is no simpler way to specify
|
||||
# that an instance is receiving a specific message.
|
||||
|
||||
RSpec.describe Settings::ZonesController, type: :controller do
|
||||
|
||||
# This should return the minimal set of attributes required to create a valid
|
||||
# Settings::Zone. As you add validations to Settings::Zone, be sure to
|
||||
# adjust the attributes here as well.
|
||||
let(:valid_attributes) {
|
||||
skip("Add a hash of attributes valid for your model")
|
||||
}
|
||||
|
||||
let(:invalid_attributes) {
|
||||
skip("Add a hash of attributes invalid for your model")
|
||||
}
|
||||
|
||||
# This should return the minimal set of values that should be in the session
|
||||
# in order to pass any filters (e.g. authentication) defined in
|
||||
# Settings::ZonesController. Be sure to keep this updated too.
|
||||
let(:valid_session) { {} }
|
||||
|
||||
describe "GET #index" do
|
||||
it "assigns all settings_zones as @settings_zones" do
|
||||
zone = Settings::Zone.create! valid_attributes
|
||||
get :index, params: {}, session: valid_session
|
||||
expect(assigns(:settings_zones)).to eq([zone])
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #show" do
|
||||
it "assigns the requested settings_zone as @settings_zone" do
|
||||
zone = Settings::Zone.create! valid_attributes
|
||||
get :show, params: {id: zone.to_param}, session: valid_session
|
||||
expect(assigns(:settings_zone)).to eq(zone)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #new" do
|
||||
it "assigns a new settings_zone as @settings_zone" do
|
||||
get :new, params: {}, session: valid_session
|
||||
expect(assigns(:settings_zone)).to be_a_new(Settings::Zone)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET #edit" do
|
||||
it "assigns the requested settings_zone as @settings_zone" do
|
||||
zone = Settings::Zone.create! valid_attributes
|
||||
get :edit, params: {id: zone.to_param}, session: valid_session
|
||||
expect(assigns(:settings_zone)).to eq(zone)
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST #create" do
|
||||
context "with valid params" do
|
||||
it "creates a new Settings::Zone" do
|
||||
expect {
|
||||
post :create, params: {settings_zone: valid_attributes}, session: valid_session
|
||||
}.to change(Settings::Zone, :count).by(1)
|
||||
end
|
||||
|
||||
it "assigns a newly created settings_zone as @settings_zone" do
|
||||
post :create, params: {settings_zone: valid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_zone)).to be_a(Settings::Zone)
|
||||
expect(assigns(:settings_zone)).to be_persisted
|
||||
end
|
||||
|
||||
it "redirects to the created settings_zone" do
|
||||
post :create, params: {settings_zone: valid_attributes}, session: valid_session
|
||||
expect(response).to redirect_to(Settings::Zone.last)
|
||||
end
|
||||
end
|
||||
|
||||
context "with invalid params" do
|
||||
it "assigns a newly created but unsaved settings_zone as @settings_zone" do
|
||||
post :create, params: {settings_zone: invalid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_zone)).to be_a_new(Settings::Zone)
|
||||
end
|
||||
|
||||
it "re-renders the 'new' template" do
|
||||
post :create, params: {settings_zone: invalid_attributes}, session: valid_session
|
||||
expect(response).to render_template("new")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT #update" do
|
||||
context "with valid params" do
|
||||
let(:new_attributes) {
|
||||
skip("Add a hash of attributes valid for your model")
|
||||
}
|
||||
|
||||
it "updates the requested settings_zone" do
|
||||
zone = Settings::Zone.create! valid_attributes
|
||||
put :update, params: {id: zone.to_param, settings_zone: new_attributes}, session: valid_session
|
||||
zone.reload
|
||||
skip("Add assertions for updated state")
|
||||
end
|
||||
|
||||
it "assigns the requested settings_zone as @settings_zone" do
|
||||
zone = Settings::Zone.create! valid_attributes
|
||||
put :update, params: {id: zone.to_param, settings_zone: valid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_zone)).to eq(zone)
|
||||
end
|
||||
|
||||
it "redirects to the settings_zone" do
|
||||
zone = Settings::Zone.create! valid_attributes
|
||||
put :update, params: {id: zone.to_param, settings_zone: valid_attributes}, session: valid_session
|
||||
expect(response).to redirect_to(zone)
|
||||
end
|
||||
end
|
||||
|
||||
context "with invalid params" do
|
||||
it "assigns the settings_zone as @settings_zone" do
|
||||
zone = Settings::Zone.create! valid_attributes
|
||||
put :update, params: {id: zone.to_param, settings_zone: invalid_attributes}, session: valid_session
|
||||
expect(assigns(:settings_zone)).to eq(zone)
|
||||
end
|
||||
|
||||
it "re-renders the 'edit' template" do
|
||||
zone = Settings::Zone.create! valid_attributes
|
||||
put :update, params: {id: zone.to_param, settings_zone: invalid_attributes}, session: valid_session
|
||||
expect(response).to render_template("edit")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE #destroy" do
|
||||
it "destroys the requested settings_zone" do
|
||||
zone = Settings::Zone.create! valid_attributes
|
||||
expect {
|
||||
delete :destroy, params: {id: zone.to_param}, session: valid_session
|
||||
}.to change(Settings::Zone, :count).by(-1)
|
||||
end
|
||||
|
||||
it "redirects to the settings_zones list" do
|
||||
zone = Settings::Zone.create! valid_attributes
|
||||
delete :destroy, params: {id: zone.to_param}, session: valid_session
|
||||
expect(response).to redirect_to(settings_zones_url)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
15
spec/helpers/crm/customers_helper_spec.rb
Normal file
15
spec/helpers/crm/customers_helper_spec.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
require 'rails_helper'
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
# the Crm::CustomersHelper. For example:
|
||||
#
|
||||
# describe Crm::CustomersHelper 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::CustomersHelper, type: :helper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
15
spec/helpers/settings/cashier_terminals_helper_spec.rb
Normal file
15
spec/helpers/settings/cashier_terminals_helper_spec.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
require 'rails_helper'
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
# the Settings::CashierTerminalsHelper. For example:
|
||||
#
|
||||
# describe Settings::CashierTerminalsHelper 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 Settings::CashierTerminalsHelper, type: :helper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
15
spec/helpers/settings/lookups_helper_spec.rb
Normal file
15
spec/helpers/settings/lookups_helper_spec.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
require 'rails_helper'
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
# the Settings::LookupsHelper. For example:
|
||||
#
|
||||
# describe Settings::LookupsHelper 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 Settings::LookupsHelper, type: :helper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
15
spec/helpers/settings/membership_settings_helper_spec.rb
Normal file
15
spec/helpers/settings/membership_settings_helper_spec.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
require 'rails_helper'
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
# the Settings::MembershipSettingsHelper. For example:
|
||||
#
|
||||
# describe Settings::MembershipSettingsHelper 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 Settings::MembershipSettingsHelper, type: :helper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
15
spec/helpers/settings/menu_item_attributes_helper_spec.rb
Normal file
15
spec/helpers/settings/menu_item_attributes_helper_spec.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
require 'rails_helper'
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
# the Settings::MenuItemAttributesHelper. For example:
|
||||
#
|
||||
# describe Settings::MenuItemAttributesHelper 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 Settings::MenuItemAttributesHelper, type: :helper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user