thirteen-tien-len/spec/views/profiles/new.html.haml_spec.rb
2023-11-06 17:21:23 +00:00

28 lines
589 B
Ruby

require 'rails_helper'
RSpec.describe "profiles/new", type: :view do
before(:each) do
assign(:profile, Profile.new(
user: nil,
name: "MyString",
summary: "MyString",
about: "MyText"
))
end
it "renders new profile form" do
render
assert_select "form[action=?][method=?]", profiles_path, "post" do
assert_select "input[name=?]", "profile[user_id]"
assert_select "input[name=?]", "profile[name]"
assert_select "input[name=?]", "profile[summary]"
assert_select "textarea[name=?]", "profile[about]"
end
end
end