-
Notifications
You must be signed in to change notification settings - Fork 0
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
User Authentication + functionality #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bilalrajput09,
STATUS: CHANGES REQUIRED ♻️ ♻️
Good job so far!
There are some issues that you still need to work on to go to the next project but you are almost there!
Highlights
- All linter checks are passing ✔️ ✔️
- Your PR is professional 👍 👍
- You have done well creating your budget application,
Required Changes ♻️
Check the comments under the review.
Optional suggestions
Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better.
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.
Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.
As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.
def category_params | ||
params.permit(:name, :icon) | ||
end | ||
|
||
def spending_params | ||
params.permit(:name, :amount) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You have done well so far, but in order to properly validate your input, I think you should use strong params. i.e
params.require(:attribute_name).permit(:name, icon)
. Please fix this for bothcategory_params
andspending_params
😄
spending = Spending.new(spending_params) | ||
if current_user.spendings << spending |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OPTIONAL - Good job done so far, but to make your code easier to read and implement the belongs-to
relationship between spending and user i suggest you do:
spending = current_user.spending.new(spending_params)
<%= render "spendings/spending_nav"%> | ||
|
||
|
||
<div class="card text-bg-warning mb-4 mt-3 mx-auto d-flex flex-row" style="width: 30rem;"> | ||
<div class="card-body"> | ||
<h5 class="card-title"><%= @category.name %></h5> | ||
</div> | ||
<div class="card-body d-flex justify-content-end"> | ||
<h5 class="card-title">Total Spent: $<%= @total_spent %></h5> | ||
</div> | ||
</div> | ||
|
||
<%= render @spendings %> | ||
|
||
|
||
|
||
<%= render "categories/button_category_spendings"%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You have done well so far, but according to the project requirements, to add a new transaction:
The user fills out a form to create a new transaction with:
* name (mandatory)
* amount (mandatory)
* categories (mandatory at least one)
I suggest you make it possible for the user to choose one or more category
for the new transaction and not automatically the category that was clicked on. Please fix this 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
require 'rails_helper' | ||
|
||
RSpec.describe 'Authentication', type: :request do | ||
let(:user) { User.new(name: 'Bilal Ahmed', email: 'bilal@gmail.com', password: 'password') } | ||
|
||
before do | ||
sign_in user | ||
end | ||
|
||
it 'Should show categories for sign in users' do | ||
get categories_path | ||
expect(response).to have_http_status(:success) | ||
end | ||
|
||
it 'Should show new categories page' do | ||
get new_category_path | ||
expect(response).to have_http_status(:success) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Good job done so far, but you have not properly done your integration tests. Remember integration test should ensure that your rendered template contains the right information filled in from the database. Please fix this 👍. You can use this article as a reminder.
require 'rails_helper' | ||
|
||
RSpec.describe 'Authentication', type: :request do | ||
let(:user) { User.new(name: 'Bilal Ahmed', email: 'bilal@gmail.com', password: 'password') } | ||
|
||
before do | ||
sign_in user | ||
end | ||
|
||
it 'Should show categories for sign in users' do | ||
get categories_path | ||
expect(response).to have_http_status(:success) | ||
end | ||
|
||
it 'Should show new categories page' do | ||
get new_category_path | ||
expect(response).to have_http_status(:success) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Good job done so far, but you have not properly done your integration tests. Remember integration test should ensure that your rendered template contains the right information filled in from the database. Please fix this 👍. You can use this article as a reminder.
README.md
Outdated
|
||
### Video | ||
|
||
<a href="#">Demonstration video</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- According to the project requirements, your documentation should contain a video presentation, the presentation should contain the following:
1. The student recorded a video presenting the features of the project.
1. The maximum length of the video is 5 minutes.
1. The video contains a clear and objective description about the project in professional English. The topic and purpose of the project are made clear.
1. The video contains a demo of the project, highlighting all the project features.
1. The video contains a highlight about a piece of the code the student finds interesting or is proud of making.
> **Note:** It's recommended that students use [Loom](https://www.loom.com/) to record to video but they can use any tool they want as long as they share an online link of the uploaded video.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bilalrajput09 ,
STATUS: CHANGES REQUIRED ♻️
Great work on making the changes 👏
You've done well implementing some of the requested changes, but there are still some which aren't addressed yet.
Suggested changes
Check the comments under the review.
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.
<%= render "spendings/spending_nav"%> | ||
|
||
|
||
<div class="card text-bg-warning mb-4 mt-3 mx-auto d-flex flex-row" style="width: 30rem;"> | ||
<div class="card-body"> | ||
<h5 class="card-title"><%= @category.name %></h5> | ||
</div> | ||
<div class="card-body d-flex justify-content-end"> | ||
<h5 class="card-title">Total Spent: $<%= @total_spent %></h5> | ||
</div> | ||
</div> | ||
|
||
<%= render @spendings %> | ||
|
||
|
||
|
||
<%= render "categories/button_category_spendings"%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bilalrajput09,
Your project is complete! There is nothing else to say other than... it's time to merge it
Congratulations! 🎉
Highlights
- No linter errors ✔️
- Correct GitFlow ✔️
- Good implementations ✔️
- Descriptive
README
file ✔️
Optional suggestions
Every comment with the [OPTIONAL] prefix won't stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better. Some of them were simply missed by the previous reviewer and addressing them will really improve your application.
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.
As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.
In The Dollar Dairy Budget App
The following were implemented:
Interactions
Sign up and log in pages
Home page (categories page)
Transactions page
Add a new category page
"Add a new transaction" page
Testing requirements
Technical requirements