diff --git a/app/assets/javascripts/transactions/sales.coffee b/app/assets/javascripts/transactions/sales.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/transactions/sales.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/transactions/sales.scss b/app/assets/stylesheets/transactions/sales.scss new file mode 100644 index 00000000..2ab00c12 --- /dev/null +++ b/app/assets/stylesheets/transactions/sales.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the transactions/Sales controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/transactions/sales_controller.rb b/app/controllers/transactions/sales_controller.rb new file mode 100644 index 00000000..ea9e8ccd --- /dev/null +++ b/app/controllers/transactions/sales_controller.rb @@ -0,0 +1,74 @@ +class Transactions::SalesController < ApplicationController + before_action :set_transactions_sale, only: [:show, :edit, :update, :destroy] + + # GET /transactions/sales + # GET /transactions/sales.json + def index + @transactions_sales = Sale.all + end + + # GET /transactions/sales/1 + # GET /transactions/sales/1.json + def show + end + + # GET /transactions/sales/new + def new + @transactions_sale = Sale.new + end + + # GET /transactions/sales/1/edit + def edit + end + + # POST /transactions/sales + # POST /transactions/sales.json + def create + @transactions_sale = Sale.new(transactions_sale_params) + + respond_to do |format| + if @transactions_sale.save + format.html { redirect_to @transactions_sale, notice: 'Sale was successfully created.' } + format.json { render :show, status: :created, location: @transactions_sale } + else + format.html { render :new } + format.json { render json: @transactions_sale.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /transactions/sales/1 + # PATCH/PUT /transactions/sales/1.json + def update + respond_to do |format| + if @transactions_sale.update(transactions_sale_params) + format.html { redirect_to @transactions_sale, notice: 'Sale was successfully updated.' } + format.json { render :show, status: :ok, location: @transactions_sale } + else + format.html { render :edit } + format.json { render json: @transactions_sale.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /transactions/sales/1 + # DELETE /transactions/sales/1.json + def destroy + @transactions_sale.destroy + respond_to do |format| + format.html { redirect_to transactions_sales_url, notice: 'Sale was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_transactions_sale + @transactions_sale = Sale.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def transactions_sale_params + params.require(:transactions_sale).permit(:cashier_id, :cashier_name, :requested_by, :requested_at, :receipt_no, :receipt_date, :customer_id, :payment_status, :sale_status, :total_amount, :total_discount, :total_tax, :tax_type, :grand_total, :rounding_adjustment, :amount_received, :amount_changed) + end +end diff --git a/app/helpers/transactions/sales_helper.rb b/app/helpers/transactions/sales_helper.rb new file mode 100644 index 00000000..95aa5c87 --- /dev/null +++ b/app/helpers/transactions/sales_helper.rb @@ -0,0 +1,2 @@ +module Transactions::SalesHelper +end diff --git a/app/models/transactions.rb b/app/models/transactions.rb new file mode 100644 index 00000000..9cffb0d1 --- /dev/null +++ b/app/models/transactions.rb @@ -0,0 +1,5 @@ +module Transactions + def self.table_name_prefix + 'transactions_' + end +end diff --git a/app/views/transactions/sales/_form.html.erb b/app/views/transactions/sales/_form.html.erb new file mode 100644 index 00000000..e83e3202 --- /dev/null +++ b/app/views/transactions/sales/_form.html.erb @@ -0,0 +1,27 @@ +<%= simple_form_for(@transactions_sale) do |f| %> + <%= f.error_notification %> + +
<%= notice %>
+ +| Cashier | +Cashier name | +Requested by | +Requested at | +Receipt no | +Receipt date | +Customer | +Payment status | +Sale status | +Total amount | +Total discount | +Total tax | +Tax type | +Grand total | +Rounding adjustment | +Amount received | +Amount changed | ++ | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| <%= transactions_sale.cashier %> | +<%= transactions_sale.cashier_name %> | +<%= transactions_sale.requested_by %> | +<%= transactions_sale.requested_at %> | +<%= transactions_sale.receipt_no %> | +<%= transactions_sale.receipt_date %> | +<%= transactions_sale.customer %> | +<%= transactions_sale.payment_status %> | +<%= transactions_sale.sale_status %> | +<%= transactions_sale.total_amount %> | +<%= transactions_sale.total_discount %> | +<%= transactions_sale.total_tax %> | +<%= transactions_sale.tax_type %> | +<%= transactions_sale.grand_total %> | +<%= transactions_sale.rounding_adjustment %> | +<%= transactions_sale.amount_received %> | +<%= transactions_sale.amount_changed %> | +<%= link_to 'Show', transactions_sale %> | +<%= link_to 'Edit', edit_transactions_sale_path(transactions_sale) %> | +<%= link_to 'Destroy', transactions_sale, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ Cashier: + <%= @transactions_sale.cashier %> +
+ ++ Cashier name: + <%= @transactions_sale.cashier_name %> +
+ ++ Requested by: + <%= @transactions_sale.requested_by %> +
+ ++ Requested at: + <%= @transactions_sale.requested_at %> +
+ ++ Receipt no: + <%= @transactions_sale.receipt_no %> +
+ ++ Receipt date: + <%= @transactions_sale.receipt_date %> +
+ ++ Customer: + <%= @transactions_sale.customer %> +
+ ++ Payment status: + <%= @transactions_sale.payment_status %> +
+ ++ Sale status: + <%= @transactions_sale.sale_status %> +
+ ++ Total amount: + <%= @transactions_sale.total_amount %> +
+ ++ Total discount: + <%= @transactions_sale.total_discount %> +
+ ++ Total tax: + <%= @transactions_sale.total_tax %> +
+ ++ Tax type: + <%= @transactions_sale.tax_type %> +
+ ++ Grand total: + <%= @transactions_sale.grand_total %> +
+ ++ Rounding adjustment: + <%= @transactions_sale.rounding_adjustment %> +
+ ++ Amount received: + <%= @transactions_sale.amount_received %> +
+ ++ Amount changed: + <%= @transactions_sale.amount_changed %> +
+ +<%= link_to 'Edit', edit_transactions_sale_path(@transactions_sale) %> | +<%= link_to 'Back', transactions_sales_path %> diff --git a/app/views/transactions/sales/show.json.jbuilder b/app/views/transactions/sales/show.json.jbuilder new file mode 100644 index 00000000..48c70528 --- /dev/null +++ b/app/views/transactions/sales/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "transactions_sales/transactions_sale", transactions_sale: @transactions_sale diff --git a/config/routes.rb b/config/routes.rb index ed2cdab0..da5d8baf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -142,7 +142,12 @@ Rails.application.routes.draw do end end + #--------- Transactions Sections ------------# + namespace :transactions do + resources :sales + end + #--------- Reports Controller Sections ------------# namespace :reports do resources :sales, :only => [:index, :show] resources :orders, :only => [:index, :show] diff --git a/db/scaffold_structure b/db/scaffold_structure index 7446c21b..064f62d4 100644 --- a/db/scaffold_structure +++ b/db/scaffold_structure @@ -20,3 +20,5 @@ rails generate scaffold Setup/TaxProfile name:string rate:decimal inclusive:bool rails generate scaffold_controller Setup/CashierTerminal name:string is_active:boolean is_currently_login:boolean auto_print_receipt:string printer_name:string header:json footer:json font:string font_size:string show_tax:boolean show_cashier:boolean show_guest_info:boolean --no-migration rails generate scaffold_controller Settings/OrderQueueStation station_name:string is_active:boolean processing_items:json print_copy:boolean printer_name:string font_size:integer cut_per_item:boolean use_alternate_name:boolean created_by:string --no-migration + +rails generate scaffold_controller transactions/Sale cashier:references cashier_name:string requested_by:string requested_at:datetime receipt_no:string receipt_date:datetime customer:references payment_status:string sale_status:string total_amount:decimal total_discount:decimal total_tax:decimal tax_type:string grand_total:decimal rounding_adjustment:decimal amount_received:decimal amount_changed:decimal --no-migration diff --git a/spec/controllers/transactions/sales_controller_spec.rb b/spec/controllers/transactions/sales_controller_spec.rb new file mode 100644 index 00000000..054e2430 --- /dev/null +++ b/spec/controllers/transactions/sales_controller_spec.rb @@ -0,0 +1,141 @@ +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. +# +# Also compared to earlier versions of this generator, there are no longer any +# expectations of assigns and templates rendered. These features have been +# removed from Rails core in Rails 5, but can be added back in via the +# `rails-controller-testing` gem. + +RSpec.describe Transactions::SalesController, type: :controller do + + # This should return the minimal set of attributes required to create a valid + # Transactions::Sale. As you add validations to Transactions::Sale, 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 + # Transactions::SalesController. Be sure to keep this updated too. + let(:valid_session) { {} } + + describe "GET #index" do + it "returns a success response" do + sale = Transactions::Sale.create! valid_attributes + get :index, params: {}, session: valid_session + expect(response).to be_success + end + end + + describe "GET #show" do + it "returns a success response" do + sale = Transactions::Sale.create! valid_attributes + get :show, params: {id: sale.to_param}, session: valid_session + expect(response).to be_success + end + end + + describe "GET #new" do + it "returns a success response" do + get :new, params: {}, session: valid_session + expect(response).to be_success + end + end + + describe "GET #edit" do + it "returns a success response" do + sale = Transactions::Sale.create! valid_attributes + get :edit, params: {id: sale.to_param}, session: valid_session + expect(response).to be_success + end + end + + describe "POST #create" do + context "with valid params" do + it "creates a new Transactions::Sale" do + expect { + post :create, params: {transactions_sale: valid_attributes}, session: valid_session + }.to change(Transactions::Sale, :count).by(1) + end + + it "redirects to the created transactions_sale" do + post :create, params: {transactions_sale: valid_attributes}, session: valid_session + expect(response).to redirect_to(Transactions::Sale.last) + end + end + + context "with invalid params" do + it "returns a success response (i.e. to display the 'new' template)" do + post :create, params: {transactions_sale: invalid_attributes}, session: valid_session + expect(response).to be_success + 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 transactions_sale" do + sale = Transactions::Sale.create! valid_attributes + put :update, params: {id: sale.to_param, transactions_sale: new_attributes}, session: valid_session + sale.reload + skip("Add assertions for updated state") + end + + it "redirects to the transactions_sale" do + sale = Transactions::Sale.create! valid_attributes + put :update, params: {id: sale.to_param, transactions_sale: valid_attributes}, session: valid_session + expect(response).to redirect_to(sale) + end + end + + context "with invalid params" do + it "returns a success response (i.e. to display the 'edit' template)" do + sale = Transactions::Sale.create! valid_attributes + put :update, params: {id: sale.to_param, transactions_sale: invalid_attributes}, session: valid_session + expect(response).to be_success + end + end + end + + describe "DELETE #destroy" do + it "destroys the requested transactions_sale" do + sale = Transactions::Sale.create! valid_attributes + expect { + delete :destroy, params: {id: sale.to_param}, session: valid_session + }.to change(Transactions::Sale, :count).by(-1) + end + + it "redirects to the transactions_sales list" do + sale = Transactions::Sale.create! valid_attributes + delete :destroy, params: {id: sale.to_param}, session: valid_session + expect(response).to redirect_to(transactions_sales_url) + end + end + +end diff --git a/spec/helpers/transactions/sales_helper_spec.rb b/spec/helpers/transactions/sales_helper_spec.rb new file mode 100644 index 00000000..fd45fe62 --- /dev/null +++ b/spec/helpers/transactions/sales_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the Transactions::SalesHelper. For example: +# +# describe Transactions::SalesHelper 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 Transactions::SalesHelper, type: :helper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/transactions/sale_spec.rb b/spec/models/transactions/sale_spec.rb new file mode 100644 index 00000000..8a24dfc4 --- /dev/null +++ b/spec/models/transactions/sale_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe Transactions::Sale, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/requests/transactions/transactions_sales_spec.rb b/spec/requests/transactions/transactions_sales_spec.rb new file mode 100644 index 00000000..23ed6d80 --- /dev/null +++ b/spec/requests/transactions/transactions_sales_spec.rb @@ -0,0 +1,10 @@ +require 'rails_helper' + +RSpec.describe "Transactions::Sales", type: :request do + describe "GET /transactions_sales" do + it "works! (now write some real specs)" do + get transactions_sales_path + expect(response).to have_http_status(200) + end + end +end diff --git a/spec/routing/transactions/sales_routing_spec.rb b/spec/routing/transactions/sales_routing_spec.rb new file mode 100644 index 00000000..e81109a2 --- /dev/null +++ b/spec/routing/transactions/sales_routing_spec.rb @@ -0,0 +1,39 @@ +require "rails_helper" + +RSpec.describe Transactions::SalesController, type: :routing do + describe "routing" do + + it "routes to #index" do + expect(:get => "/transactions/sales").to route_to("transactions/sales#index") + end + + it "routes to #new" do + expect(:get => "/transactions/sales/new").to route_to("transactions/sales#new") + end + + it "routes to #show" do + expect(:get => "/transactions/sales/1").to route_to("transactions/sales#show", :id => "1") + end + + it "routes to #edit" do + expect(:get => "/transactions/sales/1/edit").to route_to("transactions/sales#edit", :id => "1") + end + + it "routes to #create" do + expect(:post => "/transactions/sales").to route_to("transactions/sales#create") + end + + it "routes to #update via PUT" do + expect(:put => "/transactions/sales/1").to route_to("transactions/sales#update", :id => "1") + end + + it "routes to #update via PATCH" do + expect(:patch => "/transactions/sales/1").to route_to("transactions/sales#update", :id => "1") + end + + it "routes to #destroy" do + expect(:delete => "/transactions/sales/1").to route_to("transactions/sales#destroy", :id => "1") + end + + end +end diff --git a/spec/views/transactions/sales/edit.html.erb_spec.rb b/spec/views/transactions/sales/edit.html.erb_spec.rb new file mode 100644 index 00000000..8ab20cd0 --- /dev/null +++ b/spec/views/transactions/sales/edit.html.erb_spec.rb @@ -0,0 +1,60 @@ +require 'rails_helper' + +RSpec.describe "transactions/sales/edit", type: :view do + before(:each) do + @transactions_sale = assign(:transactions_sale, Transactions::Sale.create!( + :cashier => nil, + :cashier_name => "MyString", + :requested_by => "MyString", + :receipt_no => "MyString", + :customer => nil, + :payment_status => "MyString", + :sale_status => "MyString", + :total_amount => "9.99", + :total_discount => "9.99", + :total_tax => "9.99", + :tax_type => "MyString", + :grand_total => "9.99", + :rounding_adjustment => "9.99", + :amount_received => "9.99", + :amount_changed => "9.99" + )) + end + + it "renders the edit transactions_sale form" do + render + + assert_select "form[action=?][method=?]", transactions_sale_path(@transactions_sale), "post" do + + assert_select "input[name=?]", "transactions_sale[cashier_id]" + + assert_select "input[name=?]", "transactions_sale[cashier_name]" + + assert_select "input[name=?]", "transactions_sale[requested_by]" + + assert_select "input[name=?]", "transactions_sale[receipt_no]" + + assert_select "input[name=?]", "transactions_sale[customer_id]" + + assert_select "input[name=?]", "transactions_sale[payment_status]" + + assert_select "input[name=?]", "transactions_sale[sale_status]" + + assert_select "input[name=?]", "transactions_sale[total_amount]" + + assert_select "input[name=?]", "transactions_sale[total_discount]" + + assert_select "input[name=?]", "transactions_sale[total_tax]" + + assert_select "input[name=?]", "transactions_sale[tax_type]" + + assert_select "input[name=?]", "transactions_sale[grand_total]" + + assert_select "input[name=?]", "transactions_sale[rounding_adjustment]" + + assert_select "input[name=?]", "transactions_sale[amount_received]" + + assert_select "input[name=?]", "transactions_sale[amount_changed]" + end + end +end diff --git a/spec/views/transactions/sales/index.html.erb_spec.rb b/spec/views/transactions/sales/index.html.erb_spec.rb new file mode 100644 index 00000000..9071ef3a --- /dev/null +++ b/spec/views/transactions/sales/index.html.erb_spec.rb @@ -0,0 +1,61 @@ +require 'rails_helper' + +RSpec.describe "transactions/sales/index", type: :view do + before(:each) do + assign(:transactions_sales, [ + Transactions::Sale.create!( + :cashier => nil, + :cashier_name => "Cashier Name", + :requested_by => "Requested By", + :receipt_no => "Receipt No", + :customer => nil, + :payment_status => "Payment Status", + :sale_status => "Sale Status", + :total_amount => "9.99", + :total_discount => "9.99", + :total_tax => "9.99", + :tax_type => "Tax Type", + :grand_total => "9.99", + :rounding_adjustment => "9.99", + :amount_received => "9.99", + :amount_changed => "9.99" + ), + Transactions::Sale.create!( + :cashier => nil, + :cashier_name => "Cashier Name", + :requested_by => "Requested By", + :receipt_no => "Receipt No", + :customer => nil, + :payment_status => "Payment Status", + :sale_status => "Sale Status", + :total_amount => "9.99", + :total_discount => "9.99", + :total_tax => "9.99", + :tax_type => "Tax Type", + :grand_total => "9.99", + :rounding_adjustment => "9.99", + :amount_received => "9.99", + :amount_changed => "9.99" + ) + ]) + end + + it "renders a list of transactions/sales" do + render + assert_select "tr>td", :text => nil.to_s, :count => 2 + assert_select "tr>td", :text => "Cashier Name".to_s, :count => 2 + assert_select "tr>td", :text => "Requested By".to_s, :count => 2 + assert_select "tr>td", :text => "Receipt No".to_s, :count => 2 + assert_select "tr>td", :text => nil.to_s, :count => 2 + assert_select "tr>td", :text => "Payment Status".to_s, :count => 2 + assert_select "tr>td", :text => "Sale Status".to_s, :count => 2 + assert_select "tr>td", :text => "9.99".to_s, :count => 2 + assert_select "tr>td", :text => "9.99".to_s, :count => 2 + assert_select "tr>td", :text => "9.99".to_s, :count => 2 + assert_select "tr>td", :text => "Tax Type".to_s, :count => 2 + assert_select "tr>td", :text => "9.99".to_s, :count => 2 + assert_select "tr>td", :text => "9.99".to_s, :count => 2 + assert_select "tr>td", :text => "9.99".to_s, :count => 2 + assert_select "tr>td", :text => "9.99".to_s, :count => 2 + end +end diff --git a/spec/views/transactions/sales/new.html.erb_spec.rb b/spec/views/transactions/sales/new.html.erb_spec.rb new file mode 100644 index 00000000..5e499ef5 --- /dev/null +++ b/spec/views/transactions/sales/new.html.erb_spec.rb @@ -0,0 +1,60 @@ +require 'rails_helper' + +RSpec.describe "transactions/sales/new", type: :view do + before(:each) do + assign(:transactions_sale, Transactions::Sale.new( + :cashier => nil, + :cashier_name => "MyString", + :requested_by => "MyString", + :receipt_no => "MyString", + :customer => nil, + :payment_status => "MyString", + :sale_status => "MyString", + :total_amount => "9.99", + :total_discount => "9.99", + :total_tax => "9.99", + :tax_type => "MyString", + :grand_total => "9.99", + :rounding_adjustment => "9.99", + :amount_received => "9.99", + :amount_changed => "9.99" + )) + end + + it "renders new transactions_sale form" do + render + + assert_select "form[action=?][method=?]", transactions_sales_path, "post" do + + assert_select "input[name=?]", "transactions_sale[cashier_id]" + + assert_select "input[name=?]", "transactions_sale[cashier_name]" + + assert_select "input[name=?]", "transactions_sale[requested_by]" + + assert_select "input[name=?]", "transactions_sale[receipt_no]" + + assert_select "input[name=?]", "transactions_sale[customer_id]" + + assert_select "input[name=?]", "transactions_sale[payment_status]" + + assert_select "input[name=?]", "transactions_sale[sale_status]" + + assert_select "input[name=?]", "transactions_sale[total_amount]" + + assert_select "input[name=?]", "transactions_sale[total_discount]" + + assert_select "input[name=?]", "transactions_sale[total_tax]" + + assert_select "input[name=?]", "transactions_sale[tax_type]" + + assert_select "input[name=?]", "transactions_sale[grand_total]" + + assert_select "input[name=?]", "transactions_sale[rounding_adjustment]" + + assert_select "input[name=?]", "transactions_sale[amount_received]" + + assert_select "input[name=?]", "transactions_sale[amount_changed]" + end + end +end diff --git a/spec/views/transactions/sales/show.html.erb_spec.rb b/spec/views/transactions/sales/show.html.erb_spec.rb new file mode 100644 index 00000000..6d2ec4cc --- /dev/null +++ b/spec/views/transactions/sales/show.html.erb_spec.rb @@ -0,0 +1,42 @@ +require 'rails_helper' + +RSpec.describe "transactions/sales/show", type: :view do + before(:each) do + @transactions_sale = assign(:transactions_sale, Transactions::Sale.create!( + :cashier => nil, + :cashier_name => "Cashier Name", + :requested_by => "Requested By", + :receipt_no => "Receipt No", + :customer => nil, + :payment_status => "Payment Status", + :sale_status => "Sale Status", + :total_amount => "9.99", + :total_discount => "9.99", + :total_tax => "9.99", + :tax_type => "Tax Type", + :grand_total => "9.99", + :rounding_adjustment => "9.99", + :amount_received => "9.99", + :amount_changed => "9.99" + )) + end + + it "renders attributes in" do + render + expect(rendered).to match(//) + expect(rendered).to match(/Cashier Name/) + expect(rendered).to match(/Requested By/) + expect(rendered).to match(/Receipt No/) + expect(rendered).to match(//) + expect(rendered).to match(/Payment Status/) + expect(rendered).to match(/Sale Status/) + expect(rendered).to match(/9.99/) + expect(rendered).to match(/9.99/) + expect(rendered).to match(/9.99/) + expect(rendered).to match(/Tax Type/) + expect(rendered).to match(/9.99/) + expect(rendered).to match(/9.99/) + expect(rendered).to match(/9.99/) + expect(rendered).to match(/9.99/) + end +end diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb new file mode 100644 index 00000000..d19212ab --- /dev/null +++ b/test/application_system_test_case.rb @@ -0,0 +1,5 @@ +require "test_helper" + +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase + driven_by :selenium, using: :chrome, screen_size: [1400, 1400] +end diff --git a/test/system/sales_test.rb b/test/system/sales_test.rb new file mode 100644 index 00000000..7df56114 --- /dev/null +++ b/test/system/sales_test.rb @@ -0,0 +1,9 @@ +require "application_system_test_case" + +class Transactions::SalesTest < ApplicationSystemTestCase + # test "visiting the index" do + # visit transactions_sales_url + # + # assert_selector "h1", text: "Transactions::Sale" + # end +end