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/recipients/index.html.erb_spec.rb

44 lines
1.3 KiB

require 'rails_helper'
RSpec.describe "recipients/index", type: :view do
before(:each) do
assign(:recipients, [
Recipient.create!(
:name => "Name",
:phone => "Phone",
:gender => "Gender",
:race => "Race",
:ethnicity => "Ethnicity",
:home_language_id => 2,
:income => "Income",
:opted_out => false,
:school_id => 3
),
Recipient.create!(
:name => "Name",
:phone => "Phone",
:gender => "Gender",
:race => "Race",
:ethnicity => "Ethnicity",
:home_language_id => 2,
:income => "Income",
:opted_out => false,
:school_id => 3
)
])
end
it "renders a list of recipients" do
render
assert_select "tr>td", :text => "Name".to_s, :count => 2
assert_select "tr>td", :text => "Phone".to_s, :count => 2
assert_select "tr>td", :text => "Gender".to_s, :count => 2
assert_select "tr>td", :text => "Race".to_s, :count => 2
assert_select "tr>td", :text => "Ethnicity".to_s, :count => 2
assert_select "tr>td", :text => 2.to_s, :count => 2
assert_select "tr>td", :text => "Income".to_s, :count => 2
assert_select "tr>td", :text => false.to_s, :count => 2
assert_select "tr>td", :text => 3.to_s, :count => 2
end
end