require 'rails_helper'

RSpec.describe "configs/edit", type: :view do
  before(:each) do
    @config = assign(:config, Config.create!(
      :key => "MyString",
      :value => "MyString",
      :description => "MyString",
      :order => 1
    ))
  end

  it "renders the edit config form" do
    render

    assert_select "form[action=?][method=?]", config_path(@config), "post" do

      assert_select "input#config_key[name=?]", "config[key]"

      assert_select "input#config_value[name=?]", "config[value]"

      assert_select "input#config_description[name=?]", "config[description]"

      assert_select "input#config_order[name=?]", "config[order]"
    end
  end
end
