forked from shibao/cannery
rename ammo_type type to class
This commit is contained in:
@ -343,21 +343,21 @@ defmodule Cannery.ActivityLogTest do
|
||||
other_user = user_fixture()
|
||||
other_container = container_fixture(other_user)
|
||||
|
||||
for type <- ["rifle", "shotgun", "pistol"] do
|
||||
other_ammo_type = ammo_type_fixture(%{type: type}, other_user)
|
||||
for class <- ["rifle", "shotgun", "pistol"] do
|
||||
other_ammo_type = ammo_type_fixture(%{class: class}, other_user)
|
||||
{1, [other_ammo_group]} = ammo_group_fixture(other_ammo_type, other_container, other_user)
|
||||
shot_group_fixture(other_user, other_ammo_group)
|
||||
end
|
||||
|
||||
rifle_ammo_type = ammo_type_fixture(%{type: "rifle"}, current_user)
|
||||
rifle_ammo_type = ammo_type_fixture(%{class: :rifle}, current_user)
|
||||
{1, [rifle_ammo_group]} = ammo_group_fixture(rifle_ammo_type, container, current_user)
|
||||
rifle_shot_group = shot_group_fixture(current_user, rifle_ammo_group)
|
||||
|
||||
shotgun_ammo_type = ammo_type_fixture(%{type: "shotgun"}, current_user)
|
||||
shotgun_ammo_type = ammo_type_fixture(%{class: :shotgun}, current_user)
|
||||
{1, [shotgun_ammo_group]} = ammo_group_fixture(shotgun_ammo_type, container, current_user)
|
||||
shotgun_shot_group = shot_group_fixture(current_user, shotgun_ammo_group)
|
||||
|
||||
pistol_ammo_type = ammo_type_fixture(%{type: "pistol"}, current_user)
|
||||
pistol_ammo_type = ammo_type_fixture(%{class: :pistol}, current_user)
|
||||
{1, [pistol_ammo_group]} = ammo_group_fixture(pistol_ammo_type, container, current_user)
|
||||
pistol_shot_group = shot_group_fixture(current_user, pistol_ammo_group)
|
||||
|
||||
|
@ -41,7 +41,7 @@ defmodule Cannery.AmmoTest do
|
||||
rifle_ammo_type =
|
||||
%{
|
||||
name: "bullets",
|
||||
type: "rifle",
|
||||
class: :rifle,
|
||||
desc: "has some pews in it",
|
||||
grains: 5
|
||||
}
|
||||
@ -50,14 +50,14 @@ defmodule Cannery.AmmoTest do
|
||||
shotgun_ammo_type =
|
||||
%{
|
||||
name: "hollows",
|
||||
type: "shotgun",
|
||||
class: :shotgun,
|
||||
grains: 3
|
||||
}
|
||||
|> ammo_type_fixture(current_user)
|
||||
|
||||
pistol_ammo_type =
|
||||
%{
|
||||
type: "pistol",
|
||||
class: :pistol,
|
||||
name: "jackets",
|
||||
desc: "brass shell",
|
||||
tracer: true
|
||||
@ -750,11 +750,11 @@ defmodule Cannery.AmmoTest do
|
||||
current_user = user_fixture()
|
||||
container = container_fixture(current_user)
|
||||
|
||||
rifle_ammo_type = ammo_type_fixture(%{type: "rifle"}, current_user)
|
||||
rifle_ammo_type = ammo_type_fixture(%{class: :rifle}, current_user)
|
||||
{1, [rifle_ammo_group]} = ammo_group_fixture(rifle_ammo_type, container, current_user)
|
||||
shotgun_ammo_type = ammo_type_fixture(%{type: "shotgun"}, current_user)
|
||||
shotgun_ammo_type = ammo_type_fixture(%{class: :shotgun}, current_user)
|
||||
{1, [shotgun_ammo_group]} = ammo_group_fixture(shotgun_ammo_type, container, current_user)
|
||||
pistol_ammo_type = ammo_type_fixture(%{type: "pistol"}, current_user)
|
||||
pistol_ammo_type = ammo_type_fixture(%{class: :pistol}, current_user)
|
||||
{1, [pistol_ammo_group]} = ammo_group_fixture(pistol_ammo_type, container, current_user)
|
||||
|
||||
assert [^rifle_ammo_group] = Ammo.list_ammo_groups(nil, :rifle, current_user, false)
|
||||
@ -858,11 +858,11 @@ defmodule Cannery.AmmoTest do
|
||||
current_user = user_fixture()
|
||||
container = container_fixture(current_user)
|
||||
|
||||
rifle_ammo_type = ammo_type_fixture(%{type: "rifle"}, current_user)
|
||||
rifle_ammo_type = ammo_type_fixture(%{class: :rifle}, current_user)
|
||||
{1, [rifle_ammo_group]} = ammo_group_fixture(rifle_ammo_type, container, current_user)
|
||||
shotgun_ammo_type = ammo_type_fixture(%{type: "shotgun"}, current_user)
|
||||
shotgun_ammo_type = ammo_type_fixture(%{class: :shotgun}, current_user)
|
||||
{1, [shotgun_ammo_group]} = ammo_group_fixture(shotgun_ammo_type, container, current_user)
|
||||
pistol_ammo_type = ammo_type_fixture(%{type: "pistol"}, current_user)
|
||||
pistol_ammo_type = ammo_type_fixture(%{class: :pistol}, current_user)
|
||||
{1, [pistol_ammo_group]} = ammo_group_fixture(pistol_ammo_type, container, current_user)
|
||||
|
||||
another_container = container_fixture(current_user)
|
||||
|
Reference in New Issue
Block a user