require 'rails_helper'

RSpec.describe "commands/edit", type: :view do
  let(:command) {
    Command.create!(
      name: "MyString",
      trigger: "MyString",
      body: "MyText"
    )
  }

  before(:each) do
    assign(:command, command)
  end

  it "renders the edit command form" do
    render

    assert_select "form[action=?][method=?]", command_path(command), "post" do

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

      assert_select "input[name=?]", "command[trigger]"

      assert_select "textarea[name=?]", "command[body]"
    end
  end
end
