Fixes and add label to tables

This commit is contained in:
2022-04-16 15:21:07 -05:00
parent 073cc9452e
commit 8b0ddff515
13 changed files with 76 additions and 38 deletions
@@ -0,0 +1,21 @@
# encoding: UTF-8
require 'rails_helper'
describe DashboardController, type: :controller do
before :each do
setup_supplier_for_controller
end
describe "GET #table_qr_image" do
it "does render the svg image" do
table = create :table, supplier: @supplier, number: 7
get :table_qr_image, params: {table_id: table.id}, format: :svg
expect(response.body).to include %[id="tspan3801">7</tspan>]
end
it "does render the svg image with table label if present" do
table = create :table, supplier: @supplier, number: 7, label: "The love seat"
get :table_qr_image, params: {table_id: table.id}, format: :svg
expect(response.body).to include %[id="tspan3801">7 - The love seat</tspan>]
end
end
end