learn-co-curriculum / simple-partials-lab

Other
0 stars 496 forks source link

Spec file has incorrect .between syntax due to update #15

Closed BenitolSantos closed 4 years ago

BenitolSantos commented 5 years ago

"https://github.com/faker-ruby/faker/blob/master/doc/default/date.md" - Nicholas Stephenson

`require "rails_helper"

RSpec.describe "classroom_show_view" do it "renders classroom information on the show view" do view.lookup_context.prefixes = %w[students] student = Student.create(name: 'Bobby', hometown: Faker::Address.city, birthday: Faker::Date.between(from: 25.years.ago, to: 18.years.ago))

original... the spec syntax is wrong. .between is changed https://github.com/faker-ruby/faker/blob/master/doc/default/date.md

#student = Student.create(name: 'Bobby', hometown: Faker::Address.city, birthday: Faker::Date.between(25.years.ago, 18.years.ago))
assign(:student, student)
render :template => "students/show.html.erb"
expect(rendered).to match /Bobby/

end

it "renders a students/student partial" do view.lookup_context.prefixes = %w[students] student = Student.create(name: 'Bobby', hometown: Faker::Address.city, birthday: Faker::Date.between(from: 25.years.ago, to: 18.years.ago))

original... the spec syntax is wrong. .between is changed https://github.com/faker-ruby/faker/blob/master/doc/default/date.md

#student = Student.create(name: 'Bobby', hometown: Faker::Address.city, birthday: Faker::Date.between(25.years.ago, 18.years.ago))
assign(:student, student)
render :template => "students/show.html.erb"
expect(rendered).to render_template(:partial => "students/_student")

end

it "displays the student information from the partial" do

original... the spec syntax is wrong. .between is changed https://github.com/faker-ruby/faker/blob/master/doc/default/date.md

#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(:student, student)
render :partial => "students/student.html.erb"
expect(rendered).to match /Bobby/

end ` end

drakeltheryuujin commented 4 years ago

It's a little bit unclear what is being shown here, but I believe the faker syntax has been updated and this issue is resolved. Please re-open this issue if the problem still persists. Thanks!