make more specs work
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# encoding: UTF-8
|
||||
require 'rails_helper'
|
||||
|
||||
describe DashboardController, type: :controller do
|
||||
before :each do
|
||||
setup_supplier_for_controller
|
||||
@@ -9,13 +10,19 @@ describe DashboardController, type: :controller 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>]
|
||||
doc = Nokogiri.parse(response.body)
|
||||
element = doc.at_css('#tspan3801')
|
||||
#expect(response.body).to include %[id="tspan3801">7</tspan>]
|
||||
expect(element.text).to eq '7'
|
||||
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>]
|
||||
doc = Nokogiri.parse(response.body)
|
||||
element = doc.at_css('#tspan3801')
|
||||
#expect(response.body).to include %[id="tspan3801">7 - The love seat</tspan>]
|
||||
expect(element.text).to eq '7 - The love seat'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user