require 'rails_helper'

RSpec.describe "print_settings/edit", type: :view do
  before(:each) do
    @print_setting = assign(:print_setting, PrintSetting.create!(
      :name, => "MyString",
      :unique_code, => "MyString",
      :template, => "MyString",
      :db_name, => "MyString",
      :db_type, => "MyString",
      :db_username, => "MyString",
      :db_password, => "MyString",
      :printer_name, => "MyString",
      :api_settings, => "MyString",
      :page_width => "",
      :page_height => "",
      :print_copies => 1
    ))
  end

  it "renders the edit print_setting form" do
    render

    assert_select "form[action=?][method=?]", print_setting_path(@print_setting), "post" do

      assert_select "input[name=?]", "print_setting[name,]"

      assert_select "input[name=?]", "print_setting[unique_code,]"

      assert_select "input[name=?]", "print_setting[template,]"

      assert_select "input[name=?]", "print_setting[db_name,]"

      assert_select "input[name=?]", "print_setting[db_type,]"

      assert_select "input[name=?]", "print_setting[db_username,]"

      assert_select "input[name=?]", "print_setting[db_password,]"

      assert_select "input[name=?]", "print_setting[printer_name,]"

      assert_select "input[name=?]", "print_setting[api_settings,]"

      assert_select "input[name=?]", "print_setting[page_width]"

      assert_select "input[name=?]", "print_setting[page_height]"

      assert_select "input[name=?]", "print_setting[print_copies]"
    end
  end
end
