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.
24 lines
585 B
24 lines
585 B
require 'rails_helper'
|
|
|
|
RSpec.describe "districts/show", type: :view do
|
|
before(:each) do
|
|
@district = assign(:district, District.create!(
|
|
:name => "Milford",
|
|
:state_id => 2
|
|
))
|
|
|
|
schools = []
|
|
3.times { |i| schools << @district.schools.create!(name: "School #{i}")}
|
|
@schools = assign(:schools, schools)
|
|
end
|
|
|
|
it "renders attributes in <p>" do
|
|
render(template: "districts/show.html.haml")
|
|
expect(rendered).to match(/Milford/)
|
|
expect(rendered).to match(/2/)
|
|
3.times do |i|
|
|
expect(rendered).to match(/School #{i}/)
|
|
end
|
|
end
|
|
end
|