thirteen-tien-len/spec/views/bots/new.html.haml_spec.rb
2023-11-28 12:04:44 +00:00

31 lines
674 B
Ruby

require 'rails_helper'
RSpec.describe "bots/new", type: :view do
before(:each) do
assign(:bot, Bot.new(
name: "MyString",
telegram_api_token: "MyString",
discord_api_token: "MyString",
user: nil,
profile: nil
))
end
it "renders new bot form" do
render
assert_select "form[action=?][method=?]", bots_path, "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