learn-co-curriculum / displaying-has-many-through-rails-lab Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
No big deal but the Doctor#index page referenced in step 2 of the instructions is not tested in the specs.
PROBLEM: Missing solution branch. See issues #13, #12
NOTIFY: @byojelly, @BuffaloRob
If something is being tested dynamically, it should be created dynamically. Hard-coding the patient/doctor ID's in the seeds file cost me over 2 hours. I changed it to dynamic creation and my code worked fine.
Doctor.create([{name:"Dudeman",....}])
Appointment.create([{doctor_id:2....}])
should be
mcsteamy = Doctor.create(name:"Dudeman")
Appointment.create([{doctor_id: mcsteamy.id ....}])
You can make a PR out of my submission. I changed it there.
Solution branch still empty - first reported Dec. 17, 2017. Closed but not resolved.
After passing the lab I wanted to review my code against the solution however the solution did not have completed code.
Thank you.
The readme says: "Create a Doctor#index page that displays each doctor's name, a link to their show page, and a count of their patients."
However, there is no test for it, and the lab passes without it.
Suggested solutions: add a test for it, or delete that sentence from the readme.
Thank you.
None of the important files are in the solution branch. There's no migrations, models, controllers, or views
not urgent but the Grey's Anatomy image isnt working
On the README for this lab it says that:
- Create a
Doctor#index
page that displays each doctor's name, a link to their show page, and a count of their patients.
When running the tests, tests for this seem to have been left out. ๐คทโโ๏ธ
Below is my test output from running learn
that doesn't show any tests about the doctor's index
page:
appointments
should display an appointment's doctor
should display an appointment's patient
should not have an index page
doctors
#show page
shows all of a doctor's appointment times in a human readable format
links to the patient's show page by name for each appointment
patients
#index page
lists all of the patients and the number of appointments they have
#show page
shows all of a patient's appointment times in a human readable format
links to the doctor's show page by name for the doctor of each appointment
Appointment
has a date and time
belongs to a patient
belongs to a doctor
Doctor
has a name
has a department
has many appointments
has many patients, through appointments
Patient
has a name
has an age
has many appointments
has many doctors, through appointments
Finished in 0.49276 seconds (files took 1.66 seconds to load)
19 examples, 0 failures
"Create an Appointment#show page that shows the date, time, patient, and doctor for that particular appointment. Note that there should NOT be an Appointment#index page โโ we don't want to have all of the appointments on display for anyone to see."
` it "should display an appointment's doctor" do
visit appointment_path(@appointment)
expect(page).to have_link("Hawkeye Pierce", href: doctor_path(@hawkeye))
end
it "should display an appointment's patient" do
visit appointment_path(@appointment)
expect(page).to have_link("Homer Simpson", href: patient_path(@homer))
end
it "should not have an index page" do
expect {visit('/appointments')}.to raise_error(ActionController::RoutingError)
end`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.