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

Convert model attributes to snake_case #43

Open
8 tasks
lucianghinda opened this issue Mar 23, 2023 · 4 comments
Open
8 tasks

Convert model attributes to snake_case #43

lucianghinda opened this issue Mar 23, 2023 · 4 comments
Assignees

Comments

@lucianghinda
Copy link
Member

Each of the following needs to be changed in at least 5 places:

  • in DB
  • in views
  • in models
  • in controllers
  • Avo resources (see app/avo/resources)

After changing those please run something like:

  • grep -rin twitterUrl . in the root of the app to check if twitterUrl still exists
    or
  • if you use ripgrep run rg -F "twitterUrl" .

Author

Change

  • twitterUrl to twitter_url in DB
  • githubUrl to github_url
  • siteUrl to website_url

Book

  • getBookOnAmazonUrl to amazon_url
  • getBookOnSiteTitle to website_title
  • getBookOnSiteUrl to website_url

Course

  • courseSiteTitle to website_title
  • courseSiteUrl to website_url
  • [ ]
@obaidashfaq20
Copy link
Contributor

can you assign this to me? @lucianghinda interested to work :)

@lucianghinda
Copy link
Member Author

@obaidashfaq20 sure

Thank you very much for wanting to work on this.

Please do each change in one PR eg. Author should be one PR, Book should be one PR, Course should be one PR.

Will be amazing (but not exactly required) if you manage to write some tests in Minitest. It is not required as the test coverage in this project is low. But I plan to start adding more tests as I find more time.

In case you want to add some tests here is a plan.
I will use this example for the author:

  1. We should use fixtures (create a file in test/fixtures/authors.yml)

  2. There should be one test that checks if the author fixture is valid (just build a new author and check .valid?)

The test could be as simple as:

class AuthorTest < ActiveSupport::TestCase
  test "fixture is valid" do
    author = authors(:one)

    assert_predicate author, :valid?
    assert_empty author.errors
  end
end
  • there should be one system tests that checks that the page /people is loading correctly and will display the name of the author

  • there should be one system test that the specific author page /people/:id is loading correctly and will display the changed fields.

@obaidashfaq20
Copy link
Contributor

Thanks for the opportunity, I am glad found this project with such responsive members.
I follow TDD, so will surely add tests, personally I like RSpec more :) but that would be a separate debate

@obaidashfaq20
Copy link
Contributor

obaidashfaq20 commented Jun 16, 2023

@lucianghinda I am planning to add the test suite for the complete project in a separate PR if that's okay?, in modular approach models, controllers, and features. For now, I just created the pull requests with desired changes only. Will update you on the test progress

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

No branches or pull requests

2 participants