fix some code style and add checks to ci

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-01-14 17:56:50 +01:00
parent fc89c563ec
commit 1217361b6c
64 changed files with 242 additions and 108 deletions

View File

@@ -6,8 +6,6 @@ defmodule EventosWeb.AccountControllerTest do
alias Eventos.Accounts
@create_attrs %{description: "some description", display_name: "some display_name", domain: "some domain", private_key: "some private_key", public_key: "some public_key", suspended: true, uri: "some uri", url: "some url", username: "some username"}
@update_attrs %{description: "some updated description", display_name: "some updated display_name", domain: "some updated domain", private_key: "some updated private_key", public_key: "some updated public_key", suspended: false, uri: "some updated uri", url: "some updated url", username: "some updated username"}
@invalid_attrs %{description: nil, display_name: nil, domain: nil, private_key: nil, public_key: nil, suspended: nil, uri: nil, url: nil, username: nil}
def fixture(:account) do
{:ok, account} = Accounts.create_account(@create_attrs)

View File

@@ -7,7 +7,7 @@ defmodule EventosWeb.UserControllerTest do
alias Eventos.Accounts.User
@create_attrs %{email: "foo@bar.tld", password: "some password_hash", username: "some username"}
@update_attrs %{email: "foo@fighters.tld", password: "some updated password_hash", username: "some updated username"}
# @update_attrs %{email: "foo@fighters.tld", password: "some updated password_hash", username: "some updated username"}
@invalid_attrs %{email: "not an email", password: nil, username: nil}
def fixture(:user) do
@@ -33,6 +33,7 @@ defmodule EventosWeb.UserControllerTest do
test "renders user when data is valid", %{conn: conn} do
conn = post conn, user_path(conn, :create), @create_attrs
assert %{"user" => %{"id" => id}} = json_response(conn, 201)
assert id > 0
end
test "renders errors when data is invalid", %{conn: conn} do