Skip to content

Commit a9b7a7f

Browse files
committed
fix failing tests
1 parent 47face9 commit a9b7a7f

File tree

5 files changed

+27
-24
lines changed

5 files changed

+27
-24
lines changed

config/test.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ config :algora, :local_store,
6464
ttl: String.to_integer(System.get_env("LOCAL_STORE_TTL", "3600")),
6565
salt: System.get_env("LOCAL_STORE_SALT", "algora-local-store")
6666

67+
config :algora, :discord, webhook_url: System.get_env("DISCORD_WEBHOOK_URL")
68+
6769
config :algora,
6870
plausible_embed_url: System.get_env("PLAUSIBLE_EMBED_URL"),
6971
assets_url: System.get_env("ASSETS_URL"),

lib/algora/jobs/jobs.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule Algora.Jobs do
44
import Ecto.Changeset
55
import Ecto.Query
66

7-
alias Algora.Accounts
7+
alias Algora.Accounts.User
88
alias Algora.Bounties.LineItem
99
alias Algora.Jobs.JobApplication
1010
alias Algora.Jobs.JobPosting

lib/algora/workspace/workspace.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ defmodule Algora.Workspace do
609609
end
610610
end
611611

612-
@spec list_user_contributions(list(String.t()), map()) :: {:ok, list(map())} | {:error, term()}
612+
@spec list_user_contributions(list(String.t()), Keyword.t()) :: {:ok, list(map())} | {:error, term()}
613613
def list_user_contributions(ids, opts \\ []) do
614614
query =
615615
from uc in UserContribution,

lib/algora_web/live/org/job_live.ex

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@ defmodule AlgoraWeb.Org.JobLive do
5050
if job.user_id == socket.assigns.current_org.id do
5151
if connected?(socket), do: subscribe(job)
5252

53+
discount =
54+
if price = socket.assigns.current_org.subscription_price do
55+
Money.sub!(price(), price)
56+
end
57+
5358
{:ok,
5459
socket
60+
|> assign(:discount, discount)
5561
|> assign(:wire_details, Settings.get_wire_details())
5662
|> assign(:share_url, url(~p"/#{handle}/jobs/"))
5763
|> assign(:page_title, job.title)
@@ -1656,17 +1662,15 @@ defmodule AlgoraWeb.Org.JobLive do
16561662
</span>
16571663
</div>
16581664
1659-
<%= if discount = Money.sub!(price(), @current_org.subscription_price) do %>
1660-
<%= if Money.positive?(discount) do %>
1661-
<div class="flex justify-between items-center">
1662-
<span class="text-sm text-muted-foreground">
1663-
Early Believer Discount:
1664-
</span>
1665-
<span class="font-semibold font-display -ml-1.5">
1666-
-{Money.to_string!(discount)}
1667-
</span>
1668-
</div>
1669-
<% end %>
1665+
<%= if Money.positive?(@discount) do %>
1666+
<div class="flex justify-between items-center">
1667+
<span class="text-sm text-muted-foreground">
1668+
Early Believer Discount:
1669+
</span>
1670+
<span class="font-semibold font-display -ml-1.5">
1671+
-{Money.to_string!(@discount)}
1672+
</span>
1673+
</div>
16701674
<% end %>
16711675
<div class="flex justify-between items-center">
16721676
<span class="text-sm text-muted-foreground">Processing Fee (4%)</span>
@@ -1774,17 +1778,15 @@ defmodule AlgoraWeb.Org.JobLive do
17741778
{Money.to_string!(price())}
17751779
</span>
17761780
1777-
<%= if discount = Money.sub!(price(), @current_org.subscription_price) do %>
1778-
<%= if Money.positive?(discount) do %>
1779-
<span class="text-muted-foreground block">
1780-
Early Believer Discount
1781-
</span>
1782-
<span class="font-medium font-display flex">
1783-
<span class="-ml-1.5">
1784-
-{Money.to_string!(discount)}
1785-
</span>
1781+
<%= if Money.positive?(@discount) do %>
1782+
<span class="text-muted-foreground block">
1783+
Early Believer Discount
1784+
</span>
1785+
<span class="font-medium font-display flex">
1786+
<span class="-ml-1.5">
1787+
-{Money.to_string!(@discount)}
17861788
</span>
1787-
<% end %>
1789+
</span>
17881790
<% end %>
17891791
17901792
<span class="text-muted-foreground line-through block">

test/algora_web/controllers/webhooks/stripe_controller_test.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ defmodule AlgoraWeb.Webhooks.StripeControllerTest do
1010
alias Algora.Bounties
1111
alias Algora.Bounties.Bounty
1212
alias Algora.Bounties.Tip
13-
alias Algora.Contracts.Contract
1413
alias Algora.Payments
1514
alias Algora.Payments.PaymentMethod
1615
alias Algora.Payments.Transaction

0 commit comments

Comments
 (0)