Add github id in player structs for tests
This commit is contained in:
parent
e0bf863949
commit
bd96a70ad9
@ -55,8 +55,8 @@ export const Home = () => {
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<>
|
||||
<p>Looks like you're not signed in 👀. </p>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -1,3 +0,0 @@
|
||||
TODO:
|
||||
- [ ] When password changed, remove all sessions
|
||||
- [ ] When session removed, ssh connection closed
|
@ -2,7 +2,7 @@ defmodule Chessh.Auth.PasswordAuthenticatorTest do
|
||||
use ExUnit.Case
|
||||
alias Chessh.{Player, Repo}
|
||||
|
||||
@valid_user %{username: "logan", password: "password"}
|
||||
@valid_user %{username: "logan", password: "password", github_id: 1}
|
||||
|
||||
setup_all do
|
||||
Ecto.Adapters.SQL.Sandbox.checkout(Repo)
|
||||
|
@ -2,7 +2,7 @@ defmodule Chessh.Auth.PublicKeyAuthenticatorTest do
|
||||
use ExUnit.Case
|
||||
alias Chessh.{Key, Repo, Player}
|
||||
|
||||
@valid_user %{username: "logan", password: "password"}
|
||||
@valid_user %{username: "logan", password: "password", github_id: 2}
|
||||
@valid_key %{
|
||||
name: "The Gamer Machine",
|
||||
key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ/2LOJGGEd/dhFgRxJ5MMv0jJw4s4pA8qmMbZyulN44"
|
||||
|
@ -3,10 +3,10 @@ defmodule Chessh.Auth.UserRegistrationTest do
|
||||
use ExUnit.Case
|
||||
alias Chessh.{Player, Repo}
|
||||
|
||||
@valid_user %{username: "logan", password: "password"}
|
||||
@invalid_username %{username: "a", password: "password"}
|
||||
@invalid_password %{username: "aasdf", password: "pass"}
|
||||
@repeated_username %{username: "LoGan", password: "password"}
|
||||
@valid_user %{username: "logan", password: "password", github_id: 4}
|
||||
@invalid_username %{username: "a", password: "password", github_id: 7}
|
||||
@invalid_password %{username: "aasdf", password: "pass", github_id: 6}
|
||||
@repeated_username %{username: "LoGan", password: "password", github_id: 5}
|
||||
|
||||
test "Password must be at least 8 characters and username must be at least 2" do
|
||||
refute Player.registration_changeset(%Player{}, @invalid_password).valid?
|
||||
|
@ -5,7 +5,7 @@ defmodule Chessh.SSH.AuthTest do
|
||||
@localhost '127.0.0.1'
|
||||
@localhost_inet {{127, 0, 0, 1}, 1}
|
||||
@key_name "The Gamer Machine"
|
||||
@valid_user %{username: "logan", password: "password"}
|
||||
@valid_user %{username: "logan", password: "password", github_id: 3}
|
||||
@client_test_keys_dir Path.join(Application.compile_env!(:chessh, :key_dir), "client_keys")
|
||||
@client_pub_key 'id_ed25519.pub'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user