Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fake data script #57

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Fake data script #57

wants to merge 16 commits into from

Conversation

razztech
Copy link

What this PR does:

This pull request implements two scripts that populate the database for testing / development. One of them creates fake schools and the other one creates fake teachers. The PR also includes rspec tests that test the functionality/reliability of the script.

Include screenshots, videos, etc.

Here are some screenshots with the fake data generated by the scripts to populate the database.
Screenshot 2024-04-24 at 4 55 58 PM
Screenshot 2024-04-24 at 4 56 16 PM

Who authored this PR?

@razztech

How should this PR be tested?

rails db:populate_teachers
bundle exec rspec

  • What do the specs/features test?
  • Overall script functionality: mainly testing that new entries in the db are created for teachers and schools.

Are there any complications to deploying this?

Run bundle install since the PR adds the Faker gem used for the fake data.

New 💎: Faker

Copy link

codecov bot commented Apr 25, 2024

Codecov Report

Attention: Patch coverage is 3.70370% with 52 lines in your changes are missing coverage. Please review.

Project coverage is 80.61%. Comparing base (15b71fb) to head (3dbfc14).
Report is 62 commits behind head on main.

❗ Current head 3dbfc14 differs from pull request most recent head 16fd7ba. Consider uploading reports for the commit 16fd7ba to get more accurate results

Files Patch % Lines
lib/teacher_creator.rb 0.00% 28 Missing ⚠️
lib/school_creator.rb 0.00% 22 Missing ⚠️
app/models/school.rb 50.00% 1 Missing ⚠️
app/models/teacher.rb 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #57      +/-   ##
==========================================
- Coverage   85.11%   80.61%   -4.51%     
==========================================
  Files          29       31       +2     
  Lines         927      980      +53     
==========================================
+ Hits          789      790       +1     
- Misses        138      190      +52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ArushC
Copy link

ArushC commented Apr 25, 2024

@razztech are you sure everything that you wrote has been tested? The CodeCov is giving a bunch of lines not covered warnings but idk it might be a glitch...

Copy link
Member

@cycomachead cycomachead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great -- really minor things, that I'll merge soon. :)

Gemfile Outdated Show resolved Hide resolved
app/models/school.rb Outdated Show resolved Hide resolved
app/models/teacher.rb Outdated Show resolved Hide resolved
lib/school_creator.rb Outdated Show resolved Hide resolved
lib/school_creator.rb Outdated Show resolved Hide resolved
lib/tasks/populate_teachers.rake Outdated Show resolved Hide resolved
lib/tasks/populate_teachers.rake Outdated Show resolved Hide resolved
spec/lib/school_creator_spec.rb Outdated Show resolved Hide resolved
spec/lib/school_creator_spec.rb Outdated Show resolved Hide resolved
spec/lib/teacher_creator_spec.rb Outdated Show resolved Hide resolved
lib/school_creator.rb Outdated Show resolved Hide resolved
lib/school_creator.rb Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants