8000 Add validation for non-billable projects by apoorv1316 · Pull Request #1689 · saeloun/miru-web · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add validation for non-billable projects #1689

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

Merged
merged 5 commits into from
Mar 20, 2024

Conversation

apoorv1316
Copy link
Collaborator

@apoorv1316 apoorv1316 requested a review from nisusam March 6, 2024 13:51

def validate_billable_project
if !project&.billable && bill_status == "unbilled"
errors.add(:base, I18n.t(:errors)[:validate_billable_project])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use I18n.t("errors.validate_billable_project")

timesheet_entry = build(:timesheet_entry, bill_status: "unbilled")
expect(timesheet_entry.valid?).to be_falsey
expect(timesheet_entry.errors.messages[:base]).to include(error_message)
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, add test cases for valid timesheet entries.

@apoorv1316 apoorv1316 requested a review from nisusam March 20, 2024 06:06
@apoorv1316
Copy link
Collaborator Author

@nisusam Please review

Copy link
Collaborator
@nisusam nisusam left a comment

Choose a reason for hiding this comment

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

Please rebase

@apoorv1316 apoorv1316 merged commit 40a2a77 into develop Mar 20, 2024
@apoorv1316 apoorv1316 deleted the add-validation-non-billable-projects branch March 20, 2024 06:45
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.

2 participants
0