Skip to content

Commit

Permalink
fix faker calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchey0713 committed Aug 8, 2019
1 parent e0b12a5 commit 6085f3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/views/classroom_show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

RSpec.describe 'classroom_show_view' do
let(:classroom) { Classroom.create(course_name: 'Math', semester: "Spring #{Time.now.year}") }
let(:student) { Student.create(name: 'Bobby', hometown: Faker::Address.city, birthday: Faker::Date.between(25.years.ago, 18.years.ago)) }
let(:student) { Student.create(name: 'Bobby', hometown: Faker::Address.city, birthday: Faker::Date.between(from: 25.years.ago, to: 18.years.ago)) }

before do
5.times do
Student.create(name: Faker::Name.name, hometown: Faker::Address.city, birthday: Faker::Date.between(25.years.ago, 18.years.ago))
Student.create(name: Faker::Name.name, hometown: Faker::Address.city, birthday: Faker::Date.between(from: 25.years.ago, to: 18.years.ago))
end
Student.all.each do |student|
ClassroomStudent.create(student: student, classroom: classroom)
Expand All @@ -15,7 +15,7 @@

it 'renders classroom information on the show view' do
view.lookup_context.prefixes = %w[students classrooms]
student = Student.create(name: 'Bobby', hometown: Faker::Address.city, birthday: Faker::Date.between(25.years.ago, 18.years.ago))
student = Student.create(name: 'Bobby', hometown: Faker::Address.city, birthday: Faker::Date.between(from: 25.years.ago, to: 18.years.ago))
assign(:classroom, classroom)
render template: 'classrooms/show.html.erb'
expect(rendered).to match /Math/
Expand Down

0 comments on commit 6085f3c

Please sign in to comment.