require 'rails_helper'

RSpec.describe "print_settings/show", type: :view do
  before(:each) do
    @print_setting = assign(:print_setting, PrintSetting.create!(
      :name, => "Name,",
      :unique_code, => "Unique Code,",
      :template, => "Template,",
      :db_name, => "Db Name,",
      :db_type, => "Db Type,",
      :db_username, => "Db Username,",
      :db_password, => "Db Password,",
      :printer_name, => "Printer Name,",
      :api_settings, => "Api Settings,",
      :page_width => "",
      :page_height => "",
      :print_copies => 2
    ))
  end

  it "renders attributes in <p>" do
    render
    expect(rendered).to match(/Name,/)
    expect(rendered).to match(/Unique Code,/)
    expect(rendered).to match(/Template,/)
    expect(rendered).to match(/Db Name,/)
    expect(rendered).to match(/Db Type,/)
    expect(rendered).to match(/Db Username,/)
    expect(rendered).to match(/Db Password,/)
    expect(rendered).to match(/Printer Name,/)
    expect(rendered).to match(/Api Settings,/)
    expect(rendered).to match(//)
    expect(rendered).to match(//)
    expect(rendered).to match(/2/)
  end
end
