31 lines
674 B
Ruby
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
|