Skip to content

Commit

Permalink
added one test to make sure parital gets called in students show
Browse files Browse the repository at this point in the history
  • Loading branch information
blake41 committed Jan 21, 2016
1 parent e8d9dbc commit 2d26138
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions spec/views/student_show_spec.rb
Expand Up @@ -16,7 +16,7 @@
ClassroomStudent.create(student: oldest_student, classroom: classroom)
end

it "renders student information from the show view" do
it "renders student information from the classrooms show view" do
view.lookup_context.prefixes = %w[students]
assign(:classroom, classroom)
assign(:student, classroom.oldest_student)
Expand All @@ -32,9 +32,17 @@
expect(rendered).to render_template(:partial => "students/_student")
end

it "displays the student information from the partial" do
it "displays the student information from the student partial" do
view.lookup_context.prefixes = %w[students]
assign(:student, classroom.oldest_student)
render :partial => "students/student.html.erb"
expect(rendered).to match /Grandpa/
end

it "displays the student information from students the partial" do
view.lookup_context.prefixes = %w[students]
assign(:student, classroom.oldest_student)
render :template => "students/show.html.erb"
expect(rendered).to render_template(:partial => "students/_student")
end
end

0 comments on commit 2d26138

Please sign in to comment.