scaffold models
This commit is contained in:
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
|
||||
15
spec/helpers/settings/menu_item_options_helper_spec.rb
Normal file
15
spec/helpers/settings/menu_item_options_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::MenuItemOptionsHelper. For example:
|
||||
#
|
||||
# describe Settings::MenuItemOptionsHelper 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::MenuItemOptionsHelper, type: :helper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
15
spec/helpers/settings/payment_method_settings_helper_spec.rb
Normal file
15
spec/helpers/settings/payment_method_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::PaymentMethodSettingsHelper. For example:
|
||||
#
|
||||
# describe Settings::PaymentMethodSettingsHelper 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::PaymentMethodSettingsHelper, type: :helper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
15
spec/helpers/settings/zones_helper_spec.rb
Normal file
15
spec/helpers/settings/zones_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::ZonesHelper. For example:
|
||||
#
|
||||
# describe Settings::ZonesHelper 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::ZonesHelper, type: :helper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
10
spec/requests/crm/crm_customers_spec.rb
Normal file
10
spec/requests/crm/crm_customers_spec.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "Crm::Customers", type: :request do
|
||||
describe "GET /crm_customers" do
|
||||
it "works! (now write some real specs)" do
|
||||
get crm_customers_path
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
10
spec/requests/settings/settings_cashier_terminals_spec.rb
Normal file
10
spec/requests/settings/settings_cashier_terminals_spec.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "Settings::CashierTerminals", type: :request do
|
||||
describe "GET /settings_cashier_terminals" do
|
||||
it "works! (now write some real specs)" do
|
||||
get settings_cashier_terminals_path
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
10
spec/requests/settings/settings_lookups_spec.rb
Normal file
10
spec/requests/settings/settings_lookups_spec.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "Settings::Lookups", type: :request do
|
||||
describe "GET /settings_lookups" do
|
||||
it "works! (now write some real specs)" do
|
||||
get settings_lookups_path
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
10
spec/requests/settings/settings_membership_settings_spec.rb
Normal file
10
spec/requests/settings/settings_membership_settings_spec.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "Settings::MembershipSettings", type: :request do
|
||||
describe "GET /settings_membership_settings" do
|
||||
it "works! (now write some real specs)" do
|
||||
get settings_membership_settings_path
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
10
spec/requests/settings/settings_menu_item_attributes_spec.rb
Normal file
10
spec/requests/settings/settings_menu_item_attributes_spec.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "Settings::MenuItemAttributes", type: :request do
|
||||
describe "GET /settings_menu_item_attributes" do
|
||||
it "works! (now write some real specs)" do
|
||||
get settings_menu_item_attributes_path
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
10
spec/requests/settings/settings_menu_item_options_spec.rb
Normal file
10
spec/requests/settings/settings_menu_item_options_spec.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "Settings::MenuItemOptions", type: :request do
|
||||
describe "GET /settings_menu_item_options" do
|
||||
it "works! (now write some real specs)" do
|
||||
get settings_menu_item_options_path
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,10 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "Settings::PaymentMethodSettings", type: :request do
|
||||
describe "GET /settings_payment_method_settings" do
|
||||
it "works! (now write some real specs)" do
|
||||
get settings_payment_method_settings_path
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
10
spec/requests/settings/settings_zones_spec.rb
Normal file
10
spec/requests/settings/settings_zones_spec.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "Settings::Zones", type: :request do
|
||||
describe "GET /settings_zones" do
|
||||
it "works! (now write some real specs)" do
|
||||
get settings_zones_path
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
39
spec/routing/crm/customers_routing_spec.rb
Normal file
39
spec/routing/crm/customers_routing_spec.rb
Normal file
@@ -0,0 +1,39 @@
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe Crm::CustomersController, type: :routing do
|
||||
describe "routing" do
|
||||
|
||||
it "routes to #index" do
|
||||
expect(:get => "/crm/customers").to route_to("crm/customers#index")
|
||||
end
|
||||
|
||||
it "routes to #new" do
|
||||
expect(:get => "/crm/customers/new").to route_to("crm/customers#new")
|
||||
end
|
||||
|
||||
it "routes to #show" do
|
||||
expect(:get => "/crm/customers/1").to route_to("crm/customers#show", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #edit" do
|
||||
expect(:get => "/crm/customers/1/edit").to route_to("crm/customers#edit", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #create" do
|
||||
expect(:post => "/crm/customers").to route_to("crm/customers#create")
|
||||
end
|
||||
|
||||
it "routes to #update via PUT" do
|
||||
expect(:put => "/crm/customers/1").to route_to("crm/customers#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #update via PATCH" do
|
||||
expect(:patch => "/crm/customers/1").to route_to("crm/customers#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #destroy" do
|
||||
expect(:delete => "/crm/customers/1").to route_to("crm/customers#destroy", :id => "1")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
39
spec/routing/settings/cashier_terminals_routing_spec.rb
Normal file
39
spec/routing/settings/cashier_terminals_routing_spec.rb
Normal file
@@ -0,0 +1,39 @@
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe Settings::CashierTerminalsController, type: :routing do
|
||||
describe "routing" do
|
||||
|
||||
it "routes to #index" do
|
||||
expect(:get => "/settings/cashier_terminals").to route_to("settings/cashier_terminals#index")
|
||||
end
|
||||
|
||||
it "routes to #new" do
|
||||
expect(:get => "/settings/cashier_terminals/new").to route_to("settings/cashier_terminals#new")
|
||||
end
|
||||
|
||||
it "routes to #show" do
|
||||
expect(:get => "/settings/cashier_terminals/1").to route_to("settings/cashier_terminals#show", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #edit" do
|
||||
expect(:get => "/settings/cashier_terminals/1/edit").to route_to("settings/cashier_terminals#edit", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #create" do
|
||||
expect(:post => "/settings/cashier_terminals").to route_to("settings/cashier_terminals#create")
|
||||
end
|
||||
|
||||
it "routes to #update via PUT" do
|
||||
expect(:put => "/settings/cashier_terminals/1").to route_to("settings/cashier_terminals#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #update via PATCH" do
|
||||
expect(:patch => "/settings/cashier_terminals/1").to route_to("settings/cashier_terminals#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #destroy" do
|
||||
expect(:delete => "/settings/cashier_terminals/1").to route_to("settings/cashier_terminals#destroy", :id => "1")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
39
spec/routing/settings/lookups_routing_spec.rb
Normal file
39
spec/routing/settings/lookups_routing_spec.rb
Normal file
@@ -0,0 +1,39 @@
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe Settings::LookupsController, type: :routing do
|
||||
describe "routing" do
|
||||
|
||||
it "routes to #index" do
|
||||
expect(:get => "/settings/lookups").to route_to("settings/lookups#index")
|
||||
end
|
||||
|
||||
it "routes to #new" do
|
||||
expect(:get => "/settings/lookups/new").to route_to("settings/lookups#new")
|
||||
end
|
||||
|
||||
it "routes to #show" do
|
||||
expect(:get => "/settings/lookups/1").to route_to("settings/lookups#show", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #edit" do
|
||||
expect(:get => "/settings/lookups/1/edit").to route_to("settings/lookups#edit", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #create" do
|
||||
expect(:post => "/settings/lookups").to route_to("settings/lookups#create")
|
||||
end
|
||||
|
||||
it "routes to #update via PUT" do
|
||||
expect(:put => "/settings/lookups/1").to route_to("settings/lookups#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #update via PATCH" do
|
||||
expect(:patch => "/settings/lookups/1").to route_to("settings/lookups#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #destroy" do
|
||||
expect(:delete => "/settings/lookups/1").to route_to("settings/lookups#destroy", :id => "1")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
39
spec/routing/settings/membership_settings_routing_spec.rb
Normal file
39
spec/routing/settings/membership_settings_routing_spec.rb
Normal file
@@ -0,0 +1,39 @@
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe Settings::MembershipSettingsController, type: :routing do
|
||||
describe "routing" do
|
||||
|
||||
it "routes to #index" do
|
||||
expect(:get => "/settings/membership_settings").to route_to("settings/membership_settings#index")
|
||||
end
|
||||
|
||||
it "routes to #new" do
|
||||
expect(:get => "/settings/membership_settings/new").to route_to("settings/membership_settings#new")
|
||||
end
|
||||
|
||||
it "routes to #show" do
|
||||
expect(:get => "/settings/membership_settings/1").to route_to("settings/membership_settings#show", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #edit" do
|
||||
expect(:get => "/settings/membership_settings/1/edit").to route_to("settings/membership_settings#edit", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #create" do
|
||||
expect(:post => "/settings/membership_settings").to route_to("settings/membership_settings#create")
|
||||
end
|
||||
|
||||
it "routes to #update via PUT" do
|
||||
expect(:put => "/settings/membership_settings/1").to route_to("settings/membership_settings#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #update via PATCH" do
|
||||
expect(:patch => "/settings/membership_settings/1").to route_to("settings/membership_settings#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #destroy" do
|
||||
expect(:delete => "/settings/membership_settings/1").to route_to("settings/membership_settings#destroy", :id => "1")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
39
spec/routing/settings/menu_item_attributes_routing_spec.rb
Normal file
39
spec/routing/settings/menu_item_attributes_routing_spec.rb
Normal file
@@ -0,0 +1,39 @@
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe Settings::MenuItemAttributesController, type: :routing do
|
||||
describe "routing" do
|
||||
|
||||
it "routes to #index" do
|
||||
expect(:get => "/settings/menu_item_attributes").to route_to("settings/menu_item_attributes#index")
|
||||
end
|
||||
|
||||
it "routes to #new" do
|
||||
expect(:get => "/settings/menu_item_attributes/new").to route_to("settings/menu_item_attributes#new")
|
||||
end
|
||||
|
||||
it "routes to #show" do
|
||||
expect(:get => "/settings/menu_item_attributes/1").to route_to("settings/menu_item_attributes#show", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #edit" do
|
||||
expect(:get => "/settings/menu_item_attributes/1/edit").to route_to("settings/menu_item_attributes#edit", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #create" do
|
||||
expect(:post => "/settings/menu_item_attributes").to route_to("settings/menu_item_attributes#create")
|
||||
end
|
||||
|
||||
it "routes to #update via PUT" do
|
||||
expect(:put => "/settings/menu_item_attributes/1").to route_to("settings/menu_item_attributes#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #update via PATCH" do
|
||||
expect(:patch => "/settings/menu_item_attributes/1").to route_to("settings/menu_item_attributes#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #destroy" do
|
||||
expect(:delete => "/settings/menu_item_attributes/1").to route_to("settings/menu_item_attributes#destroy", :id => "1")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
39
spec/routing/settings/menu_item_options_routing_spec.rb
Normal file
39
spec/routing/settings/menu_item_options_routing_spec.rb
Normal file
@@ -0,0 +1,39 @@
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe Settings::MenuItemOptionsController, type: :routing do
|
||||
describe "routing" do
|
||||
|
||||
it "routes to #index" do
|
||||
expect(:get => "/settings/menu_item_options").to route_to("settings/menu_item_options#index")
|
||||
end
|
||||
|
||||
it "routes to #new" do
|
||||
expect(:get => "/settings/menu_item_options/new").to route_to("settings/menu_item_options#new")
|
||||
end
|
||||
|
||||
it "routes to #show" do
|
||||
expect(:get => "/settings/menu_item_options/1").to route_to("settings/menu_item_options#show", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #edit" do
|
||||
expect(:get => "/settings/menu_item_options/1/edit").to route_to("settings/menu_item_options#edit", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #create" do
|
||||
expect(:post => "/settings/menu_item_options").to route_to("settings/menu_item_options#create")
|
||||
end
|
||||
|
||||
it "routes to #update via PUT" do
|
||||
expect(:put => "/settings/menu_item_options/1").to route_to("settings/menu_item_options#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #update via PATCH" do
|
||||
expect(:patch => "/settings/menu_item_options/1").to route_to("settings/menu_item_options#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #destroy" do
|
||||
expect(:delete => "/settings/menu_item_options/1").to route_to("settings/menu_item_options#destroy", :id => "1")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,39 @@
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe Settings::PaymentMethodSettingsController, type: :routing do
|
||||
describe "routing" do
|
||||
|
||||
it "routes to #index" do
|
||||
expect(:get => "/settings/payment_method_settings").to route_to("settings/payment_method_settings#index")
|
||||
end
|
||||
|
||||
it "routes to #new" do
|
||||
expect(:get => "/settings/payment_method_settings/new").to route_to("settings/payment_method_settings#new")
|
||||
end
|
||||
|
||||
it "routes to #show" do
|
||||
expect(:get => "/settings/payment_method_settings/1").to route_to("settings/payment_method_settings#show", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #edit" do
|
||||
expect(:get => "/settings/payment_method_settings/1/edit").to route_to("settings/payment_method_settings#edit", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #create" do
|
||||
expect(:post => "/settings/payment_method_settings").to route_to("settings/payment_method_settings#create")
|
||||
end
|
||||
|
||||
it "routes to #update via PUT" do
|
||||
expect(:put => "/settings/payment_method_settings/1").to route_to("settings/payment_method_settings#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #update via PATCH" do
|
||||
expect(:patch => "/settings/payment_method_settings/1").to route_to("settings/payment_method_settings#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #destroy" do
|
||||
expect(:delete => "/settings/payment_method_settings/1").to route_to("settings/payment_method_settings#destroy", :id => "1")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
39
spec/routing/settings/zones_routing_spec.rb
Normal file
39
spec/routing/settings/zones_routing_spec.rb
Normal file
@@ -0,0 +1,39 @@
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe Settings::ZonesController, type: :routing do
|
||||
describe "routing" do
|
||||
|
||||
it "routes to #index" do
|
||||
expect(:get => "/settings/zones").to route_to("settings/zones#index")
|
||||
end
|
||||
|
||||
it "routes to #new" do
|
||||
expect(:get => "/settings/zones/new").to route_to("settings/zones#new")
|
||||
end
|
||||
|
||||
it "routes to #show" do
|
||||
expect(:get => "/settings/zones/1").to route_to("settings/zones#show", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #edit" do
|
||||
expect(:get => "/settings/zones/1/edit").to route_to("settings/zones#edit", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #create" do
|
||||
expect(:post => "/settings/zones").to route_to("settings/zones#create")
|
||||
end
|
||||
|
||||
it "routes to #update via PUT" do
|
||||
expect(:put => "/settings/zones/1").to route_to("settings/zones#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #update via PATCH" do
|
||||
expect(:patch => "/settings/zones/1").to route_to("settings/zones#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #destroy" do
|
||||
expect(:delete => "/settings/zones/1").to route_to("settings/zones#destroy", :id => "1")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
36
spec/views/crm/customers/edit.html.erb_spec.rb
Normal file
36
spec/views/crm/customers/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,36 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "crm/customers/edit", type: :view do
|
||||
before(:each) do
|
||||
@crm_customer = assign(:crm_customer, Crm::Customer.create!(
|
||||
:name => "MyString",
|
||||
:company => "MyString",
|
||||
:contact_no => "MyString",
|
||||
:email => "MyString",
|
||||
:membership => nil,
|
||||
:membership_type => "MyString",
|
||||
:membership_authentication_code => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit crm_customer form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", crm_customer_path(@crm_customer), "post" do
|
||||
|
||||
assert_select "input#crm_customer_name[name=?]", "crm_customer[name]"
|
||||
|
||||
assert_select "input#crm_customer_company[name=?]", "crm_customer[company]"
|
||||
|
||||
assert_select "input#crm_customer_contact_no[name=?]", "crm_customer[contact_no]"
|
||||
|
||||
assert_select "input#crm_customer_email[name=?]", "crm_customer[email]"
|
||||
|
||||
assert_select "input#crm_customer_membership_id[name=?]", "crm_customer[membership_id]"
|
||||
|
||||
assert_select "input#crm_customer_membership_type[name=?]", "crm_customer[membership_type]"
|
||||
|
||||
assert_select "input#crm_customer_membership_authentication_code[name=?]", "crm_customer[membership_authentication_code]"
|
||||
end
|
||||
end
|
||||
end
|
||||
37
spec/views/crm/customers/index.html.erb_spec.rb
Normal file
37
spec/views/crm/customers/index.html.erb_spec.rb
Normal file
@@ -0,0 +1,37 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "crm/customers/index", type: :view do
|
||||
before(:each) do
|
||||
assign(:crm_customers, [
|
||||
Crm::Customer.create!(
|
||||
:name => "Name",
|
||||
:company => "Company",
|
||||
:contact_no => "Contact No",
|
||||
:email => "Email",
|
||||
:membership => nil,
|
||||
:membership_type => "Membership Type",
|
||||
:membership_authentication_code => "Membership Authentication Code"
|
||||
),
|
||||
Crm::Customer.create!(
|
||||
:name => "Name",
|
||||
:company => "Company",
|
||||
:contact_no => "Contact No",
|
||||
:email => "Email",
|
||||
:membership => nil,
|
||||
:membership_type => "Membership Type",
|
||||
:membership_authentication_code => "Membership Authentication Code"
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of crm/customers" do
|
||||
render
|
||||
assert_select "tr>td", :text => "Name".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Company".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Contact No".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Email".to_s, :count => 2
|
||||
assert_select "tr>td", :text => nil.to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Membership Type".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Membership Authentication Code".to_s, :count => 2
|
||||
end
|
||||
end
|
||||
36
spec/views/crm/customers/new.html.erb_spec.rb
Normal file
36
spec/views/crm/customers/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,36 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "crm/customers/new", type: :view do
|
||||
before(:each) do
|
||||
assign(:crm_customer, Crm::Customer.new(
|
||||
:name => "MyString",
|
||||
:company => "MyString",
|
||||
:contact_no => "MyString",
|
||||
:email => "MyString",
|
||||
:membership => nil,
|
||||
:membership_type => "MyString",
|
||||
:membership_authentication_code => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders new crm_customer form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", crm_customers_path, "post" do
|
||||
|
||||
assert_select "input#crm_customer_name[name=?]", "crm_customer[name]"
|
||||
|
||||
assert_select "input#crm_customer_company[name=?]", "crm_customer[company]"
|
||||
|
||||
assert_select "input#crm_customer_contact_no[name=?]", "crm_customer[contact_no]"
|
||||
|
||||
assert_select "input#crm_customer_email[name=?]", "crm_customer[email]"
|
||||
|
||||
assert_select "input#crm_customer_membership_id[name=?]", "crm_customer[membership_id]"
|
||||
|
||||
assert_select "input#crm_customer_membership_type[name=?]", "crm_customer[membership_type]"
|
||||
|
||||
assert_select "input#crm_customer_membership_authentication_code[name=?]", "crm_customer[membership_authentication_code]"
|
||||
end
|
||||
end
|
||||
end
|
||||
26
spec/views/crm/customers/show.html.erb_spec.rb
Normal file
26
spec/views/crm/customers/show.html.erb_spec.rb
Normal file
@@ -0,0 +1,26 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "crm/customers/show", type: :view do
|
||||
before(:each) do
|
||||
@crm_customer = assign(:crm_customer, Crm::Customer.create!(
|
||||
:name => "Name",
|
||||
:company => "Company",
|
||||
:contact_no => "Contact No",
|
||||
:email => "Email",
|
||||
:membership => nil,
|
||||
:membership_type => "Membership Type",
|
||||
:membership_authentication_code => "Membership Authentication Code"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders attributes in <p>" do
|
||||
render
|
||||
expect(rendered).to match(/Name/)
|
||||
expect(rendered).to match(/Company/)
|
||||
expect(rendered).to match(/Contact No/)
|
||||
expect(rendered).to match(/Email/)
|
||||
expect(rendered).to match(//)
|
||||
expect(rendered).to match(/Membership Type/)
|
||||
expect(rendered).to match(/Membership Authentication Code/)
|
||||
end
|
||||
end
|
||||
51
spec/views/settings/cashier_terminals/edit.html.erb_spec.rb
Normal file
51
spec/views/settings/cashier_terminals/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,51 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/cashier_terminals/edit", type: :view do
|
||||
before(:each) do
|
||||
@settings_cashier_terminal = assign(:settings_cashier_terminal, Settings::CashierTerminal.create!(
|
||||
:name => "MyString",
|
||||
:is_active => false,
|
||||
:is_currently_login => false,
|
||||
:auto_print_receipt => "MyString",
|
||||
:printer_name => "MyString",
|
||||
:header => "",
|
||||
:footer => "",
|
||||
:font => "MyString",
|
||||
:font_size => "MyString",
|
||||
:show_tax => false,
|
||||
:show_cashier => false,
|
||||
:show_guest_info => false
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit settings_cashier_terminal form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", settings_cashier_terminal_path(@settings_cashier_terminal), "post" do
|
||||
|
||||
assert_select "input#settings_cashier_terminal_name[name=?]", "settings_cashier_terminal[name]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_is_active[name=?]", "settings_cashier_terminal[is_active]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_is_currently_login[name=?]", "settings_cashier_terminal[is_currently_login]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_auto_print_receipt[name=?]", "settings_cashier_terminal[auto_print_receipt]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_printer_name[name=?]", "settings_cashier_terminal[printer_name]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_header[name=?]", "settings_cashier_terminal[header]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_footer[name=?]", "settings_cashier_terminal[footer]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_font[name=?]", "settings_cashier_terminal[font]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_font_size[name=?]", "settings_cashier_terminal[font_size]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_show_tax[name=?]", "settings_cashier_terminal[show_tax]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_show_cashier[name=?]", "settings_cashier_terminal[show_cashier]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_show_guest_info[name=?]", "settings_cashier_terminal[show_guest_info]"
|
||||
end
|
||||
end
|
||||
end
|
||||
52
spec/views/settings/cashier_terminals/index.html.erb_spec.rb
Normal file
52
spec/views/settings/cashier_terminals/index.html.erb_spec.rb
Normal file
@@ -0,0 +1,52 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/cashier_terminals/index", type: :view do
|
||||
before(:each) do
|
||||
assign(:settings_cashier_terminals, [
|
||||
Settings::CashierTerminal.create!(
|
||||
:name => "Name",
|
||||
:is_active => false,
|
||||
:is_currently_login => false,
|
||||
:auto_print_receipt => "Auto Print Receipt",
|
||||
:printer_name => "Printer Name",
|
||||
:header => "",
|
||||
:footer => "",
|
||||
:font => "Font",
|
||||
:font_size => "Font Size",
|
||||
:show_tax => false,
|
||||
:show_cashier => false,
|
||||
:show_guest_info => false
|
||||
),
|
||||
Settings::CashierTerminal.create!(
|
||||
:name => "Name",
|
||||
:is_active => false,
|
||||
:is_currently_login => false,
|
||||
:auto_print_receipt => "Auto Print Receipt",
|
||||
:printer_name => "Printer Name",
|
||||
:header => "",
|
||||
:footer => "",
|
||||
:font => "Font",
|
||||
:font_size => "Font Size",
|
||||
:show_tax => false,
|
||||
:show_cashier => false,
|
||||
:show_guest_info => false
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of settings/cashier_terminals" do
|
||||
render
|
||||
assert_select "tr>td", :text => "Name".to_s, :count => 2
|
||||
assert_select "tr>td", :text => false.to_s, :count => 2
|
||||
assert_select "tr>td", :text => false.to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Auto Print Receipt".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Printer Name".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Font".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Font Size".to_s, :count => 2
|
||||
assert_select "tr>td", :text => false.to_s, :count => 2
|
||||
assert_select "tr>td", :text => false.to_s, :count => 2
|
||||
assert_select "tr>td", :text => false.to_s, :count => 2
|
||||
end
|
||||
end
|
||||
51
spec/views/settings/cashier_terminals/new.html.erb_spec.rb
Normal file
51
spec/views/settings/cashier_terminals/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,51 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/cashier_terminals/new", type: :view do
|
||||
before(:each) do
|
||||
assign(:settings_cashier_terminal, Settings::CashierTerminal.new(
|
||||
:name => "MyString",
|
||||
:is_active => false,
|
||||
:is_currently_login => false,
|
||||
:auto_print_receipt => "MyString",
|
||||
:printer_name => "MyString",
|
||||
:header => "",
|
||||
:footer => "",
|
||||
:font => "MyString",
|
||||
:font_size => "MyString",
|
||||
:show_tax => false,
|
||||
:show_cashier => false,
|
||||
:show_guest_info => false
|
||||
))
|
||||
end
|
||||
|
||||
it "renders new settings_cashier_terminal form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", settings_cashier_terminals_path, "post" do
|
||||
|
||||
assert_select "input#settings_cashier_terminal_name[name=?]", "settings_cashier_terminal[name]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_is_active[name=?]", "settings_cashier_terminal[is_active]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_is_currently_login[name=?]", "settings_cashier_terminal[is_currently_login]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_auto_print_receipt[name=?]", "settings_cashier_terminal[auto_print_receipt]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_printer_name[name=?]", "settings_cashier_terminal[printer_name]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_header[name=?]", "settings_cashier_terminal[header]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_footer[name=?]", "settings_cashier_terminal[footer]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_font[name=?]", "settings_cashier_terminal[font]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_font_size[name=?]", "settings_cashier_terminal[font_size]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_show_tax[name=?]", "settings_cashier_terminal[show_tax]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_show_cashier[name=?]", "settings_cashier_terminal[show_cashier]"
|
||||
|
||||
assert_select "input#settings_cashier_terminal_show_guest_info[name=?]", "settings_cashier_terminal[show_guest_info]"
|
||||
end
|
||||
end
|
||||
end
|
||||
36
spec/views/settings/cashier_terminals/show.html.erb_spec.rb
Normal file
36
spec/views/settings/cashier_terminals/show.html.erb_spec.rb
Normal file
@@ -0,0 +1,36 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/cashier_terminals/show", type: :view do
|
||||
before(:each) do
|
||||
@settings_cashier_terminal = assign(:settings_cashier_terminal, Settings::CashierTerminal.create!(
|
||||
:name => "Name",
|
||||
:is_active => false,
|
||||
:is_currently_login => false,
|
||||
:auto_print_receipt => "Auto Print Receipt",
|
||||
:printer_name => "Printer Name",
|
||||
:header => "",
|
||||
:footer => "",
|
||||
:font => "Font",
|
||||
:font_size => "Font Size",
|
||||
:show_tax => false,
|
||||
:show_cashier => false,
|
||||
:show_guest_info => false
|
||||
))
|
||||
end
|
||||
|
||||
it "renders attributes in <p>" do
|
||||
render
|
||||
expect(rendered).to match(/Name/)
|
||||
expect(rendered).to match(/false/)
|
||||
expect(rendered).to match(/false/)
|
||||
expect(rendered).to match(/Auto Print Receipt/)
|
||||
expect(rendered).to match(/Printer Name/)
|
||||
expect(rendered).to match(//)
|
||||
expect(rendered).to match(//)
|
||||
expect(rendered).to match(/Font/)
|
||||
expect(rendered).to match(/Font Size/)
|
||||
expect(rendered).to match(/false/)
|
||||
expect(rendered).to match(/false/)
|
||||
expect(rendered).to match(/false/)
|
||||
end
|
||||
end
|
||||
24
spec/views/settings/lookups/edit.html.erb_spec.rb
Normal file
24
spec/views/settings/lookups/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/lookups/edit", type: :view do
|
||||
before(:each) do
|
||||
@settings_lookup = assign(:settings_lookup, Settings::Lookup.create!(
|
||||
:lookup_type => "MyString",
|
||||
:name => "MyString",
|
||||
:value => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit settings_lookup form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", settings_lookup_path(@settings_lookup), "post" do
|
||||
|
||||
assert_select "input#settings_lookup_lookup_type[name=?]", "settings_lookup[lookup_type]"
|
||||
|
||||
assert_select "input#settings_lookup_name[name=?]", "settings_lookup[name]"
|
||||
|
||||
assert_select "input#settings_lookup_value[name=?]", "settings_lookup[value]"
|
||||
end
|
||||
end
|
||||
end
|
||||
25
spec/views/settings/lookups/index.html.erb_spec.rb
Normal file
25
spec/views/settings/lookups/index.html.erb_spec.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/lookups/index", type: :view do
|
||||
before(:each) do
|
||||
assign(:settings_lookups, [
|
||||
Settings::Lookup.create!(
|
||||
:lookup_type => "Lookup Type",
|
||||
:name => "Name",
|
||||
:value => "Value"
|
||||
),
|
||||
Settings::Lookup.create!(
|
||||
:lookup_type => "Lookup Type",
|
||||
:name => "Name",
|
||||
:value => "Value"
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of settings/lookups" do
|
||||
render
|
||||
assert_select "tr>td", :text => "Lookup Type".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Name".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Value".to_s, :count => 2
|
||||
end
|
||||
end
|
||||
24
spec/views/settings/lookups/new.html.erb_spec.rb
Normal file
24
spec/views/settings/lookups/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/lookups/new", type: :view do
|
||||
before(:each) do
|
||||
assign(:settings_lookup, Settings::Lookup.new(
|
||||
:lookup_type => "MyString",
|
||||
:name => "MyString",
|
||||
:value => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders new settings_lookup form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", settings_lookups_path, "post" do
|
||||
|
||||
assert_select "input#settings_lookup_lookup_type[name=?]", "settings_lookup[lookup_type]"
|
||||
|
||||
assert_select "input#settings_lookup_name[name=?]", "settings_lookup[name]"
|
||||
|
||||
assert_select "input#settings_lookup_value[name=?]", "settings_lookup[value]"
|
||||
end
|
||||
end
|
||||
end
|
||||
18
spec/views/settings/lookups/show.html.erb_spec.rb
Normal file
18
spec/views/settings/lookups/show.html.erb_spec.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/lookups/show", type: :view do
|
||||
before(:each) do
|
||||
@settings_lookup = assign(:settings_lookup, Settings::Lookup.create!(
|
||||
:lookup_type => "Lookup Type",
|
||||
:name => "Name",
|
||||
:value => "Value"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders attributes in <p>" do
|
||||
render
|
||||
expect(rendered).to match(/Lookup Type/)
|
||||
expect(rendered).to match(/Name/)
|
||||
expect(rendered).to match(/Value/)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,36 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/membership_settings/edit", type: :view do
|
||||
before(:each) do
|
||||
@settings_membership_setting = assign(:settings_membership_setting, Settings::MembershipSetting.create!(
|
||||
:membership_type => "MyString",
|
||||
:is_active => false,
|
||||
:gateway_communication_type => "MyString",
|
||||
:gateway_url => "MyString",
|
||||
:auth_token => "MyString",
|
||||
:merchant_account => nil,
|
||||
:created_by => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit settings_membership_setting form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", settings_membership_setting_path(@settings_membership_setting), "post" do
|
||||
|
||||
assert_select "input#settings_membership_setting_membership_type[name=?]", "settings_membership_setting[membership_type]"
|
||||
|
||||
assert_select "input#settings_membership_setting_is_active[name=?]", "settings_membership_setting[is_active]"
|
||||
|
||||
assert_select "input#settings_membership_setting_gateway_communication_type[name=?]", "settings_membership_setting[gateway_communication_type]"
|
||||
|
||||
assert_select "input#settings_membership_setting_gateway_url[name=?]", "settings_membership_setting[gateway_url]"
|
||||
|
||||
assert_select "input#settings_membership_setting_auth_token[name=?]", "settings_membership_setting[auth_token]"
|
||||
|
||||
assert_select "input#settings_membership_setting_merchant_account_id[name=?]", "settings_membership_setting[merchant_account_id]"
|
||||
|
||||
assert_select "input#settings_membership_setting_created_by[name=?]", "settings_membership_setting[created_by]"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,37 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/membership_settings/index", type: :view do
|
||||
before(:each) do
|
||||
assign(:settings_membership_settings, [
|
||||
Settings::MembershipSetting.create!(
|
||||
:membership_type => "Membership Type",
|
||||
:is_active => false,
|
||||
:gateway_communication_type => "Gateway Communication Type",
|
||||
:gateway_url => "Gateway Url",
|
||||
:auth_token => "Auth Token",
|
||||
:merchant_account => nil,
|
||||
:created_by => "Created By"
|
||||
),
|
||||
Settings::MembershipSetting.create!(
|
||||
:membership_type => "Membership Type",
|
||||
:is_active => false,
|
||||
:gateway_communication_type => "Gateway Communication Type",
|
||||
:gateway_url => "Gateway Url",
|
||||
:auth_token => "Auth Token",
|
||||
:merchant_account => nil,
|
||||
:created_by => "Created By"
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of settings/membership_settings" do
|
||||
render
|
||||
assert_select "tr>td", :text => "Membership Type".to_s, :count => 2
|
||||
assert_select "tr>td", :text => false.to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Gateway Communication Type".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Gateway Url".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Auth Token".to_s, :count => 2
|
||||
assert_select "tr>td", :text => nil.to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Created By".to_s, :count => 2
|
||||
end
|
||||
end
|
||||
36
spec/views/settings/membership_settings/new.html.erb_spec.rb
Normal file
36
spec/views/settings/membership_settings/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,36 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/membership_settings/new", type: :view do
|
||||
before(:each) do
|
||||
assign(:settings_membership_setting, Settings::MembershipSetting.new(
|
||||
:membership_type => "MyString",
|
||||
:is_active => false,
|
||||
:gateway_communication_type => "MyString",
|
||||
:gateway_url => "MyString",
|
||||
:auth_token => "MyString",
|
||||
:merchant_account => nil,
|
||||
:created_by => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders new settings_membership_setting form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", settings_membership_settings_path, "post" do
|
||||
|
||||
assert_select "input#settings_membership_setting_membership_type[name=?]", "settings_membership_setting[membership_type]"
|
||||
|
||||
assert_select "input#settings_membership_setting_is_active[name=?]", "settings_membership_setting[is_active]"
|
||||
|
||||
assert_select "input#settings_membership_setting_gateway_communication_type[name=?]", "settings_membership_setting[gateway_communication_type]"
|
||||
|
||||
assert_select "input#settings_membership_setting_gateway_url[name=?]", "settings_membership_setting[gateway_url]"
|
||||
|
||||
assert_select "input#settings_membership_setting_auth_token[name=?]", "settings_membership_setting[auth_token]"
|
||||
|
||||
assert_select "input#settings_membership_setting_merchant_account_id[name=?]", "settings_membership_setting[merchant_account_id]"
|
||||
|
||||
assert_select "input#settings_membership_setting_created_by[name=?]", "settings_membership_setting[created_by]"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,26 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/membership_settings/show", type: :view do
|
||||
before(:each) do
|
||||
@settings_membership_setting = assign(:settings_membership_setting, Settings::MembershipSetting.create!(
|
||||
:membership_type => "Membership Type",
|
||||
:is_active => false,
|
||||
:gateway_communication_type => "Gateway Communication Type",
|
||||
:gateway_url => "Gateway Url",
|
||||
:auth_token => "Auth Token",
|
||||
:merchant_account => nil,
|
||||
:created_by => "Created By"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders attributes in <p>" do
|
||||
render
|
||||
expect(rendered).to match(/Membership Type/)
|
||||
expect(rendered).to match(/false/)
|
||||
expect(rendered).to match(/Gateway Communication Type/)
|
||||
expect(rendered).to match(/Gateway Url/)
|
||||
expect(rendered).to match(/Auth Token/)
|
||||
expect(rendered).to match(//)
|
||||
expect(rendered).to match(/Created By/)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,24 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/menu_item_attributes/edit", type: :view do
|
||||
before(:each) do
|
||||
@settings_menu_item_attribute = assign(:settings_menu_item_attribute, Settings::MenuItemAttribute.create!(
|
||||
:attribute_type => "MyString",
|
||||
:name => "MyString",
|
||||
:value => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit settings_menu_item_attribute form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", settings_menu_item_attribute_path(@settings_menu_item_attribute), "post" do
|
||||
|
||||
assert_select "input#settings_menu_item_attribute_attribute_type[name=?]", "settings_menu_item_attribute[attribute_type]"
|
||||
|
||||
assert_select "input#settings_menu_item_attribute_name[name=?]", "settings_menu_item_attribute[name]"
|
||||
|
||||
assert_select "input#settings_menu_item_attribute_value[name=?]", "settings_menu_item_attribute[value]"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,25 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/menu_item_attributes/index", type: :view do
|
||||
before(:each) do
|
||||
assign(:settings_menu_item_attributes, [
|
||||
Settings::MenuItemAttribute.create!(
|
||||
:attribute_type => "Attribute Type",
|
||||
:name => "Name",
|
||||
:value => "Value"
|
||||
),
|
||||
Settings::MenuItemAttribute.create!(
|
||||
:attribute_type => "Attribute Type",
|
||||
:name => "Name",
|
||||
:value => "Value"
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of settings/menu_item_attributes" do
|
||||
render
|
||||
assert_select "tr>td", :text => "Attribute Type".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Name".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Value".to_s, :count => 2
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,24 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/menu_item_attributes/new", type: :view do
|
||||
before(:each) do
|
||||
assign(:settings_menu_item_attribute, Settings::MenuItemAttribute.new(
|
||||
:attribute_type => "MyString",
|
||||
:name => "MyString",
|
||||
:value => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders new settings_menu_item_attribute form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", settings_menu_item_attributes_path, "post" do
|
||||
|
||||
assert_select "input#settings_menu_item_attribute_attribute_type[name=?]", "settings_menu_item_attribute[attribute_type]"
|
||||
|
||||
assert_select "input#settings_menu_item_attribute_name[name=?]", "settings_menu_item_attribute[name]"
|
||||
|
||||
assert_select "input#settings_menu_item_attribute_value[name=?]", "settings_menu_item_attribute[value]"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,18 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/menu_item_attributes/show", type: :view do
|
||||
before(:each) do
|
||||
@settings_menu_item_attribute = assign(:settings_menu_item_attribute, Settings::MenuItemAttribute.create!(
|
||||
:attribute_type => "Attribute Type",
|
||||
:name => "Name",
|
||||
:value => "Value"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders attributes in <p>" do
|
||||
render
|
||||
expect(rendered).to match(/Attribute Type/)
|
||||
expect(rendered).to match(/Name/)
|
||||
expect(rendered).to match(/Value/)
|
||||
end
|
||||
end
|
||||
21
spec/views/settings/menu_item_options/edit.html.erb_spec.rb
Normal file
21
spec/views/settings/menu_item_options/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/menu_item_options/edit", type: :view do
|
||||
before(:each) do
|
||||
@settings_menu_item_option = assign(:settings_menu_item_option, Settings::MenuItemOption.create!(
|
||||
:name => "MyString",
|
||||
:value => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit settings_menu_item_option form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", settings_menu_item_option_path(@settings_menu_item_option), "post" do
|
||||
|
||||
assert_select "input#settings_menu_item_option_name[name=?]", "settings_menu_item_option[name]"
|
||||
|
||||
assert_select "input#settings_menu_item_option_value[name=?]", "settings_menu_item_option[value]"
|
||||
end
|
||||
end
|
||||
end
|
||||
22
spec/views/settings/menu_item_options/index.html.erb_spec.rb
Normal file
22
spec/views/settings/menu_item_options/index.html.erb_spec.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/menu_item_options/index", type: :view do
|
||||
before(:each) do
|
||||
assign(:settings_menu_item_options, [
|
||||
Settings::MenuItemOption.create!(
|
||||
:name => "Name",
|
||||
:value => "Value"
|
||||
),
|
||||
Settings::MenuItemOption.create!(
|
||||
:name => "Name",
|
||||
:value => "Value"
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of settings/menu_item_options" do
|
||||
render
|
||||
assert_select "tr>td", :text => "Name".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Value".to_s, :count => 2
|
||||
end
|
||||
end
|
||||
21
spec/views/settings/menu_item_options/new.html.erb_spec.rb
Normal file
21
spec/views/settings/menu_item_options/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/menu_item_options/new", type: :view do
|
||||
before(:each) do
|
||||
assign(:settings_menu_item_option, Settings::MenuItemOption.new(
|
||||
:name => "MyString",
|
||||
:value => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders new settings_menu_item_option form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", settings_menu_item_options_path, "post" do
|
||||
|
||||
assert_select "input#settings_menu_item_option_name[name=?]", "settings_menu_item_option[name]"
|
||||
|
||||
assert_select "input#settings_menu_item_option_value[name=?]", "settings_menu_item_option[value]"
|
||||
end
|
||||
end
|
||||
end
|
||||
16
spec/views/settings/menu_item_options/show.html.erb_spec.rb
Normal file
16
spec/views/settings/menu_item_options/show.html.erb_spec.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/menu_item_options/show", type: :view do
|
||||
before(:each) do
|
||||
@settings_menu_item_option = assign(:settings_menu_item_option, Settings::MenuItemOption.create!(
|
||||
:name => "Name",
|
||||
:value => "Value"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders attributes in <p>" do
|
||||
render
|
||||
expect(rendered).to match(/Name/)
|
||||
expect(rendered).to match(/Value/)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,33 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/payment_method_settings/edit", type: :view do
|
||||
before(:each) do
|
||||
@settings_payment_method_setting = assign(:settings_payment_method_setting, Settings::PaymentMethodSetting.create!(
|
||||
:payment_method => "MyString",
|
||||
:is_active => false,
|
||||
:gateway_communication_type => "MyString",
|
||||
:gateway_url => "MyString",
|
||||
:auth_token => "MyString",
|
||||
:merchant_account => nil
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit settings_payment_method_setting form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", settings_payment_method_setting_path(@settings_payment_method_setting), "post" do
|
||||
|
||||
assert_select "input#settings_payment_method_setting_payment_method[name=?]", "settings_payment_method_setting[payment_method]"
|
||||
|
||||
assert_select "input#settings_payment_method_setting_is_active[name=?]", "settings_payment_method_setting[is_active]"
|
||||
|
||||
assert_select "input#settings_payment_method_setting_gateway_communication_type[name=?]", "settings_payment_method_setting[gateway_communication_type]"
|
||||
|
||||
assert_select "input#settings_payment_method_setting_gateway_url[name=?]", "settings_payment_method_setting[gateway_url]"
|
||||
|
||||
assert_select "input#settings_payment_method_setting_auth_token[name=?]", "settings_payment_method_setting[auth_token]"
|
||||
|
||||
assert_select "input#settings_payment_method_setting_merchant_account_id[name=?]", "settings_payment_method_setting[merchant_account_id]"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,34 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/payment_method_settings/index", type: :view do
|
||||
before(:each) do
|
||||
assign(:settings_payment_method_settings, [
|
||||
Settings::PaymentMethodSetting.create!(
|
||||
:payment_method => "Payment Method",
|
||||
:is_active => false,
|
||||
:gateway_communication_type => "Gateway Communication Type",
|
||||
:gateway_url => "Gateway Url",
|
||||
:auth_token => "Auth Token",
|
||||
:merchant_account => nil
|
||||
),
|
||||
Settings::PaymentMethodSetting.create!(
|
||||
:payment_method => "Payment Method",
|
||||
:is_active => false,
|
||||
:gateway_communication_type => "Gateway Communication Type",
|
||||
:gateway_url => "Gateway Url",
|
||||
:auth_token => "Auth Token",
|
||||
:merchant_account => nil
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of settings/payment_method_settings" do
|
||||
render
|
||||
assert_select "tr>td", :text => "Payment Method".to_s, :count => 2
|
||||
assert_select "tr>td", :text => false.to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Gateway Communication Type".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Gateway Url".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Auth Token".to_s, :count => 2
|
||||
assert_select "tr>td", :text => nil.to_s, :count => 2
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,33 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/payment_method_settings/new", type: :view do
|
||||
before(:each) do
|
||||
assign(:settings_payment_method_setting, Settings::PaymentMethodSetting.new(
|
||||
:payment_method => "MyString",
|
||||
:is_active => false,
|
||||
:gateway_communication_type => "MyString",
|
||||
:gateway_url => "MyString",
|
||||
:auth_token => "MyString",
|
||||
:merchant_account => nil
|
||||
))
|
||||
end
|
||||
|
||||
it "renders new settings_payment_method_setting form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", settings_payment_method_settings_path, "post" do
|
||||
|
||||
assert_select "input#settings_payment_method_setting_payment_method[name=?]", "settings_payment_method_setting[payment_method]"
|
||||
|
||||
assert_select "input#settings_payment_method_setting_is_active[name=?]", "settings_payment_method_setting[is_active]"
|
||||
|
||||
assert_select "input#settings_payment_method_setting_gateway_communication_type[name=?]", "settings_payment_method_setting[gateway_communication_type]"
|
||||
|
||||
assert_select "input#settings_payment_method_setting_gateway_url[name=?]", "settings_payment_method_setting[gateway_url]"
|
||||
|
||||
assert_select "input#settings_payment_method_setting_auth_token[name=?]", "settings_payment_method_setting[auth_token]"
|
||||
|
||||
assert_select "input#settings_payment_method_setting_merchant_account_id[name=?]", "settings_payment_method_setting[merchant_account_id]"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,24 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/payment_method_settings/show", type: :view do
|
||||
before(:each) do
|
||||
@settings_payment_method_setting = assign(:settings_payment_method_setting, Settings::PaymentMethodSetting.create!(
|
||||
:payment_method => "Payment Method",
|
||||
:is_active => false,
|
||||
:gateway_communication_type => "Gateway Communication Type",
|
||||
:gateway_url => "Gateway Url",
|
||||
:auth_token => "Auth Token",
|
||||
:merchant_account => nil
|
||||
))
|
||||
end
|
||||
|
||||
it "renders attributes in <p>" do
|
||||
render
|
||||
expect(rendered).to match(/Payment Method/)
|
||||
expect(rendered).to match(/false/)
|
||||
expect(rendered).to match(/Gateway Communication Type/)
|
||||
expect(rendered).to match(/Gateway Url/)
|
||||
expect(rendered).to match(/Auth Token/)
|
||||
expect(rendered).to match(//)
|
||||
end
|
||||
end
|
||||
24
spec/views/settings/zones/edit.html.erb_spec.rb
Normal file
24
spec/views/settings/zones/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/zones/edit", type: :view do
|
||||
before(:each) do
|
||||
@settings_zone = assign(:settings_zone, Settings::Zone.create!(
|
||||
:name => "MyString",
|
||||
:is_active => false,
|
||||
:created_by => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit settings_zone form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", settings_zone_path(@settings_zone), "post" do
|
||||
|
||||
assert_select "input#settings_zone_name[name=?]", "settings_zone[name]"
|
||||
|
||||
assert_select "input#settings_zone_is_active[name=?]", "settings_zone[is_active]"
|
||||
|
||||
assert_select "input#settings_zone_created_by[name=?]", "settings_zone[created_by]"
|
||||
end
|
||||
end
|
||||
end
|
||||
25
spec/views/settings/zones/index.html.erb_spec.rb
Normal file
25
spec/views/settings/zones/index.html.erb_spec.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/zones/index", type: :view do
|
||||
before(:each) do
|
||||
assign(:settings_zones, [
|
||||
Settings::Zone.create!(
|
||||
:name => "Name",
|
||||
:is_active => false,
|
||||
:created_by => "Created By"
|
||||
),
|
||||
Settings::Zone.create!(
|
||||
:name => "Name",
|
||||
:is_active => false,
|
||||
:created_by => "Created By"
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of settings/zones" do
|
||||
render
|
||||
assert_select "tr>td", :text => "Name".to_s, :count => 2
|
||||
assert_select "tr>td", :text => false.to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Created By".to_s, :count => 2
|
||||
end
|
||||
end
|
||||
24
spec/views/settings/zones/new.html.erb_spec.rb
Normal file
24
spec/views/settings/zones/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/zones/new", type: :view do
|
||||
before(:each) do
|
||||
assign(:settings_zone, Settings::Zone.new(
|
||||
:name => "MyString",
|
||||
:is_active => false,
|
||||
:created_by => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders new settings_zone form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", settings_zones_path, "post" do
|
||||
|
||||
assert_select "input#settings_zone_name[name=?]", "settings_zone[name]"
|
||||
|
||||
assert_select "input#settings_zone_is_active[name=?]", "settings_zone[is_active]"
|
||||
|
||||
assert_select "input#settings_zone_created_by[name=?]", "settings_zone[created_by]"
|
||||
end
|
||||
end
|
||||
end
|
||||
18
spec/views/settings/zones/show.html.erb_spec.rb
Normal file
18
spec/views/settings/zones/show.html.erb_spec.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/zones/show", type: :view do
|
||||
before(:each) do
|
||||
@settings_zone = assign(:settings_zone, Settings::Zone.create!(
|
||||
:name => "Name",
|
||||
:is_active => false,
|
||||
:created_by => "Created By"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders attributes in <p>" do
|
||||
render
|
||||
expect(rendered).to match(/Name/)
|
||||
expect(rendered).to match(/false/)
|
||||
expect(rendered).to match(/Created By/)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user