25 lines
513 B
Ruby
25 lines
513 B
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe "commands/new", type: :view do
|
|
before(:each) do
|
|
assign(:command, Command.new(
|
|
name: "MyString",
|
|
trigger: "MyString",
|
|
body: "MyText"
|
|
))
|
|
end
|
|
|
|
it "renders new command form" do
|
|
render
|
|
|
|
assert_select "form[action=?][method=?]", commands_path, "post" do
|
|
|
|
assert_select "input[name=?]", "command[name]"
|
|
|
|
assert_select "input[name=?]", "command[trigger]"
|
|
|
|
assert_select "textarea[name=?]", "command[body]"
|
|
end
|
|
end
|
|
end
|