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
https://gist.github.com/df9861cc1d105701265df4256c7fd3bb |
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
Theorem andb_eq_orb : | |
forall (b c : bool), | |
b && c = b || c -> | |
b = c. | |
Proof. | |
intros b c. | |
destruct b. | |
- simpl. | |
destruct c. | |
+ reflexivity. |
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
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 |
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
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 |
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
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} |
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
....................................................................................................................................... | |
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 |
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
defmodule Api.Competition do | |
@moduledoc """ | |
TODO: Write. | |
""" | |
use Api.Web, :model | |
alias Ecto.{Changeset} | |
@valid_attrs ~w( |
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
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 |
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
defmodule Api.PaperVote do | |
@moduledoc """ | |
TODO: Write. | |
""" | |
use Api.Web, :model | |
alias Api.{Crypto, Team, Category, User} | |
@required_attrs [ |
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
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 |