You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sqm-dashboards/spec/views/legacy/recipients/edit.html.erb_spec.rb

46 lines
1.3 KiB

require 'rails_helper'
module Legacy
RSpec.describe "legacy/recipients/edit", type: :view do
before(:each) do
@school = assign(:recipient, School.create!(# TODO does this need to be :school?
:name => "School"
))
@recipient = assign(:recipient, Recipient.create!(
:name => "MyString",
:phone => "MyString",
:gender => "MyString",
:race => "MyString",
:ethnicity => "MyString",
:home_language_id => 1,
:income => "MyString",
:opted_out => false,
:school_id => @school.id
))
end
it "renders the edit recipient form" do
render
assert_select "form[action=?][method=?]", legacy_school_legacy_recipient_path(@school, @recipient), "post" do
assert_select "input#recipient_name[name=?]", "recipient[name]"
assert_select "input#recipient_phone[name=?]", "recipient[phone]"
assert_select "input#recipient_gender[name=?]", "recipient[gender]"
assert_select "input#recipient_race[name=?]", "recipient[race]"
assert_select "input#recipient_ethnicity[name=?]", "recipient[ethnicity]"
assert_select "input#recipient_home_language_id[name=?]", "recipient[home_language_id]"
assert_select "input#recipient_income[name=?]", "recipient[income]"
end
end
end
end