View competition_actions.ex
defmodule Api.CompetitionActions do
use Api.Web, :action
alias Api.{Competition, TeamActions, Vote, PaperVote, Team}
alias Ecto.{Changeset}
defp _get do
Repo.one(from(c in Competition)) || %Competition{}
end
View competition_actions.ex
defmodule Api.CompetitionActions do
use Api.Web, :action
alias Api.{Competition, TeamActions, Vote, PaperVote, Team}
alias Ecto.{Changeset}
defp _get do
Repo.one(from(c in Competition)) || %Competition{}
end
View -
diff --git a/test/controllers/admin/admin_paper_vote_controller_test.exs b/test/controllers/admin/admin_paper_vote_controller_test.exs
new file mode 100644
index 0000000..f63d82a
--- /dev/null
+++ b/test/controllers/admin/admin_paper_vote_controller_test.exs
@@ -0,0 +1,61 @@
+defmodule Api.Admin.PaperVoteControllerTest do
+ use Api.ConnCase
+
+ alias Api.{CompetitionActions}
View -
execve("/bin/bash", ["bash", "-i", "-c", "echo -n"], [/* 76 vars */]) = 0
brk(NULL) = 0x9b2000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff03c71a000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=118533, ...}) = 0
mmap(NULL, 118533, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff03c6fd000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
View -
execve("/bin/bash", ["bash", "-i", "-c", "echo -n"], [/* 76 vars */]) = 0
brk(NULL) = 0x1469000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5132035000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=118533, ...}) = 0
mmap(NULL, 118533, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5132018000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
View 63
.......................................................................................................................................
1) test voting_ended_at set twice (Api.CompetitionActionsTest)
test/actions/competition_actions_test.exs:10
** (ArgumentError) Postgrex expected an integer in -2147483648..2147483647, got <<43, 56, 71, 70, 233, 249, 65, 186, 183, 181, 147, 111, 154, 61, 218, 95>>. Please make sure the value you are passing matches the definition in your table or in your query or convert the value accordingly.
code: {:ok, _} = CompetitionActions.open_voting()
stacktrace:
(ecto) /home/pkoch/Desktop/lom/psc-api/deps/postgrex/lib/postgrex/type_module.ex:717: Ecto.Adapters.Postgres.TypeModule.encode_params/3
(postgrex) lib/postgrex/query.ex:45: DBConnection.Query.Postgrex.Query.encode/3
(db_connection) lib/db_connection.ex:1071: DBConnection.describe_run/5
View competition.ex
defmodule Api.Competition do
@moduledoc """
TODO: Write.
"""
use Api.Web, :model
alias Ecto.{Changeset}
@valid_attrs ~w(
View derp
The database for Api.Repo has been dropped
The database for Api.Repo has been created
......................................
1) test changeset redeem (Api.PaperVoteTest)
test/models/paper_vote_test.exs:28
** (RuntimeError) changing assocs with change/2 or put_change/3 is not supported, please use put_assoc/4 instead
code: assert PaperVote.changeset(%PaperVote{}, Map.merge(base_attrs, %{
stacktrace:
(ecto) lib/ecto/changeset.ex:1011: Ecto.Changeset.put_change/7
View paper_vote.ex
defmodule Api.PaperVote do
@moduledoc """
TODO: Write.
"""
use Api.Web, :model
alias Api.{Crypto, Team, Category, User}
@required_attrs [
View -
diff --git a/test/controllers/admin/admin_stats_controller_test.exs b/test/controllers/admin/admin_stats_controller_test.exs
index f3cbd21..7f7f79a 100644
--- a/test/controllers/admin/admin_stats_controller_test.exs
+++ b/test/controllers/admin/admin_stats_controller_test.exs
@@ -58,4 +58,4 @@ defmodule Api.AdminStatsControllerTest do
}
}
end
-end
\ No newline at end of file