rename project from SimpleshopTheme to Berrypod
All modules, configs, paths, and references updated. 836 tests pass, zero warnings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
defmodule SimpleshopTheme.AccountsFixtures do
|
||||
defmodule Berrypod.AccountsFixtures do
|
||||
@moduledoc """
|
||||
This module defines test helpers for creating
|
||||
entities via the `SimpleshopTheme.Accounts` context.
|
||||
entities via the `Berrypod.Accounts` context.
|
||||
"""
|
||||
|
||||
import Ecto.Query
|
||||
|
||||
alias SimpleshopTheme.Accounts
|
||||
alias SimpleshopTheme.Accounts.Scope
|
||||
alias Berrypod.Accounts
|
||||
alias Berrypod.Accounts.Scope
|
||||
|
||||
def unique_user_email, do: "user#{System.unique_integer()}@example.com"
|
||||
def valid_user_password, do: "hello world!"
|
||||
@@ -64,7 +64,7 @@ defmodule SimpleshopTheme.AccountsFixtures do
|
||||
end
|
||||
|
||||
def override_token_authenticated_at(token, authenticated_at) when is_binary(token) do
|
||||
SimpleshopTheme.Repo.update_all(
|
||||
Berrypod.Repo.update_all(
|
||||
from(t in Accounts.UserToken,
|
||||
where: t.token == ^token
|
||||
),
|
||||
@@ -74,14 +74,14 @@ defmodule SimpleshopTheme.AccountsFixtures do
|
||||
|
||||
def generate_user_magic_link_token(user) do
|
||||
{encoded_token, user_token} = Accounts.UserToken.build_email_token(user, "login")
|
||||
SimpleshopTheme.Repo.insert!(user_token)
|
||||
Berrypod.Repo.insert!(user_token)
|
||||
{encoded_token, user_token.token}
|
||||
end
|
||||
|
||||
def offset_user_token(token, amount_to_add, unit) do
|
||||
dt = DateTime.add(DateTime.utc_now(:second), amount_to_add, unit)
|
||||
|
||||
SimpleshopTheme.Repo.update_all(
|
||||
Berrypod.Repo.update_all(
|
||||
from(ut in Accounts.UserToken, where: ut.token == ^token),
|
||||
set: [inserted_at: dt, authenticated_at: dt]
|
||||
)
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
defmodule SimpleshopTheme.ImageFixtures do
|
||||
defmodule Berrypod.ImageFixtures do
|
||||
@moduledoc """
|
||||
Shared fixtures for image-related tests.
|
||||
"""
|
||||
|
||||
alias SimpleshopTheme.Repo
|
||||
alias SimpleshopTheme.Media.Image
|
||||
alias Berrypod.Repo
|
||||
alias Berrypod.Media.Image
|
||||
|
||||
@sample_jpeg File.read!("test/fixtures/sample_1200x800.jpg")
|
||||
|
||||
def sample_jpeg, do: @sample_jpeg
|
||||
|
||||
def image_fixture(attrs \\ %{}) do
|
||||
{:ok, webp, w, h} = SimpleshopTheme.Images.Optimizer.to_optimized_webp(@sample_jpeg)
|
||||
{:ok, webp, w, h} = Berrypod.Images.Optimizer.to_optimized_webp(@sample_jpeg)
|
||||
|
||||
defaults = %{
|
||||
image_type: "product",
|
||||
@@ -63,11 +63,11 @@ defmodule SimpleshopTheme.ImageFixtures do
|
||||
_ -> "#{id}-#{width}.#{ext}"
|
||||
end
|
||||
|
||||
Path.join(SimpleshopTheme.Images.Optimizer.cache_dir(), filename)
|
||||
Path.join(Berrypod.Images.Optimizer.cache_dir(), filename)
|
||||
end
|
||||
|
||||
def cleanup_cache do
|
||||
cache_dir = SimpleshopTheme.Images.Optimizer.cache_dir()
|
||||
cache_dir = Berrypod.Images.Optimizer.cache_dir()
|
||||
if File.exists?(cache_dir), do: File.rm_rf!(cache_dir)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
defmodule SimpleshopTheme.OrdersFixtures do
|
||||
defmodule Berrypod.OrdersFixtures do
|
||||
@moduledoc """
|
||||
Test helpers for creating orders.
|
||||
"""
|
||||
|
||||
alias SimpleshopTheme.Orders
|
||||
alias Berrypod.Orders
|
||||
|
||||
import SimpleshopTheme.ProductsFixtures
|
||||
import Berrypod.ProductsFixtures
|
||||
|
||||
def order_fixture(attrs \\ %{}) do
|
||||
attrs = Enum.into(attrs, %{})
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
defmodule SimpleshopTheme.ProductsFixtures do
|
||||
defmodule Berrypod.ProductsFixtures do
|
||||
@moduledoc """
|
||||
Test helpers for creating entities via the `SimpleshopTheme.Products` context.
|
||||
Test helpers for creating entities via the `Berrypod.Products` context.
|
||||
"""
|
||||
|
||||
alias SimpleshopTheme.Products
|
||||
alias Berrypod.Products
|
||||
|
||||
def unique_provider_product_id, do: "prov_#{System.unique_integer([:positive])}"
|
||||
def unique_slug, do: "product-#{System.unique_integer([:positive])}"
|
||||
@@ -186,7 +186,7 @@ defmodule SimpleshopTheme.ProductsFixtures do
|
||||
end
|
||||
|
||||
# Return product with preloaded associations
|
||||
SimpleshopTheme.Repo.preload(product, [:images, :variants])
|
||||
Berrypod.Repo.preload(product, [:images, :variants])
|
||||
end
|
||||
|
||||
@doc """
|
||||
|
||||
Reference in New Issue
Block a user