Skip to content

Commit

Permalink
- Added relevant test for car rentals
Browse files Browse the repository at this point in the history
  • Loading branch information
rushikeshpandit committed Jan 11, 2024
1 parent d8bb68e commit beaa428
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/rent_cars/rentals/create_rental_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
defmodule RentCars.Rentals.CreateRentalTest do
use RentCars.DataCase
import RentCars.CarsFixtures
alias RentCars.Rentals.CreateRental

describe "create rentals" do
test "throw error when car is not available" do
car = car_fixture(%{available: false})
assert {:error, "Car is unavailable"} == CreateRental.execute(car.id)
end
end
end

0 comments on commit beaa428

Please sign in to comment.