require 'rails_helper'

RSpec.describe "bots/edit", type: :view do
  let(:bot) {
    Bot.create!(
      name: "MyString",
      telegram_api_token: "MyString",
      discord_api_token: "MyString",
      user: nil,
      profile: nil
    )
  }

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

  it "renders the edit bot form" do
    render

    assert_select "form[action=?][method=?]", bot_path(bot), "post" do

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

      assert_select "input[name=?]", "bot[telegram_api_token]"

      assert_select "input[name=?]", "bot[discord_api_token]"

      assert_select "input[name=?]", "bot[user_id]"

      assert_select "input[name=?]", "bot[profile_id]"
    end
  end
end
