-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 400 on ninja badges index (#185)
- Loading branch information
1 parent
085d42c
commit 1a0baa7
Showing
5 changed files
with
48 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
defmodule Bokken.Factories.GamificationFactory do | ||
@moduledoc """ | ||
A factory to generate gamification related structs | ||
""" | ||
defmacro __using__(_opts) do | ||
quote do | ||
alias Bokken.Accounts.Ninja | ||
alias Bokken.Gamification.{Badge, BadgeNinja} | ||
|
||
def badge_factory do | ||
%Badge{ | ||
name: Faker.Commerce.product_name(), | ||
description: Faker.Lorem.sentence(), | ||
image: nil | ||
} | ||
end | ||
|
||
def badge_ninja_factory do | ||
%BadgeNinja{ | ||
badge: build(:badge), | ||
ninja: build(:ninja) | ||
} | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters