2021-09-26 15:22:36 -07:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
|
|
RSpec.describe "articles/new", type: :view do
|
|
|
|
|
before(:each) do
|
|
|
|
|
assign(:article, Article.new(
|
|
|
|
|
title: "MyString",
|
2021-12-16 14:40:07 -08:00
|
|
|
content: "MyContent"
|
2021-09-26 15:22:36 -07:00
|
|
|
))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it "renders new article form" do
|
|
|
|
|
render
|
|
|
|
|
|
|
|
|
|
assert_select "form[action=?][method=?]", articles_path, "post" do
|
|
|
|
|
assert_select "input[name=?]", "article[title]"
|
|
|
|
|
|
2023-12-30 16:30:37 -08:00
|
|
|
# TODO: with rich_text, this is not a textarea
|
2021-12-16 14:40:07 -08:00
|
|
|
# assert_select "textarea[name=?]", "article[content]"
|
2021-09-26 15:22:36 -07:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|