thirteen-tien-len/spec/views/profiles/edit.html.haml_spec.rb

32 lines
642 B
Ruby

require 'rails_helper'
RSpec.describe "profiles/edit", type: :view do
let(:profile) {
Profile.create!(
user: nil,
name: "MyString",
summary: "MyString",
about: "MyText"
)
}
before(:each) do
assign(:profile, profile)
end
it "renders the edit profile form" do
render
assert_select "form[action=?][method=?]", profile_path(profile), "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