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

Test updated for Freelancer Rates: Corrects a invalid test #1378

Closed
wants to merge 1 commit into from

Conversation

fparadas
Copy link

@fparadas fparadas commented Oct 5, 2023

This fixes one of freelancer rates test.

It was testing if a discount of 20% over a value of 1 was 1.2, the correct value should be 0.8.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

Thank you for contributing to exercism/elixir 💜 🎉. This is an automated PR comment 🤖 for the maintainers of this repository that helps with the PR review process. You can safely ignore it and wait for a maintainer to review your changes.

Based on the files changed in this PR, it would be good to pay attention to the following details when reviewing the PR:

  • General steps

    • 🏆 Does this PR need to receive a label with a reputation modifier (x:size/{tiny,small,medium,large,massive})? (A medium reputation amount is awarded by default, see docs)
  • Any exercise changed

    • 👤 Does the author of the PR need to be added as an author or contributor in <exercise>/.meta/config.json (see docs)?
    • 🔬 Do the analyzer and the analyzer comments exist for this exercise? Do they need to be changed?
    • 📜 Does the design file (<exercise>/.meta/design.md) need to be updated to document new implementation decisions?
  • Concept exercise changed

    • 🌲 Do prerequisites and practices in config.json need to be updated?
    • 📖 Does the concept introduction provide all necessary information to solve this exercise?
  • Concept exercise tests changed

    • ⚪️ Are all tests un-skipped?
    • 🔢 Are all tests annotated with @tag task_id?
    • 🐈 Can all tests be understood by reading the test's block only (e.g. no module attributes, no setup functions)?

Automated comment created by PR Commenter 🤖.

@@ -83,7 +83,7 @@ defmodule FreelancerRatesTest do
@tag task_id: 4
test "it applies the discount" do
# 1.25
assert FreelancerRates.days_in_budget(480, 60, 20) == 1.2
assert FreelancerRates.days_in_budget(480, 60, 20) == 0.8
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't find an issue in this test.

budget = 480, hourly_rate = 60, discount = 20%
daily_rate = 8 * 60 = 480
daily_rate_with_discount = 480 - 20% = 384
days_in_budget = 480 / 384 = 1.25 (rounded to 1.2)

Can you point to the problem?

Copy link
Author

Choose a reason for hiding this comment

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

You are correct, my bad

@fparadas fparadas closed this Oct 5, 2023
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