Skip to content

Instantly share code, notes, and snippets.

View thebrianemory's full-sized avatar

Brian Emory thebrianemory

View GitHub Profile
.no-js .top-bar {
display: none;
}
@media screen and (min-width: 40em) {
.no-js .top-bar {
display: block;
}
.no-js .title-bar {
display: none;
}
# Delete the following code
<p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
<%= if get_flash(@conn, :info) do %>
<div class="callout primary" role="alert" data-closable><%= get_flash(@conn, :info) %>
<button class="close-button" aria-label="Dismiss alert" type="button" data-close>
<span aria-hidden="true">&times;</span>
</button>
</div>
<% end %>
<%= if get_flash(@conn, :error) do %>
<div class="callout alert" role="alert" data-closable><%= get_flash(@conn, :error) %>
<button class="close-button" aria-label="Dismiss alert" type="button" data-close>
<!DOCTYPE html>
... <!-- Code removed for readability -->
<body>
<div class="container">
<%= render "_navigation.html", conn: @conn %>
<%= render "_flash.html", conn: @conn %>
... <!-- Code removed for readability -->
defmodule Catcasts.AuthControllerTest do
use Catcasts.ConnCase
test "Sign in with Google", %{conn: conn} do
conn = get conn, "/auth/google?scope=email%20profile"
assert redirected_to(conn, 302)
end
end
defmodule Catcasts.Mixfile do
use Mix.Project
... # Code removed for readability
# Type `mix help compile.app` for more information.
def application do
[mod: {Catcasts, []},
applications: [:phoenix, ... # Code removed for readability,
:postgrex, :ueberauth, :ueberauth_google]]
export GOOGLE_CLIENT_ID=your_google_client_id
export GOOGLE_CLIENT_SECRET=your_google_client_secret
# App artifacts
... # Code removed for readability
.env
defmodule Catcasts.UserTest do
use Catcasts.ModelCase
alias Catcasts.User
@valid_attrs %{token: "fahoifhaoaew0rheh0", email: "batman@example.com",
first_name: "Bruce", last_name: "Wayne", provider: "google"}
@invalid_attrs %{}
test "changeset with valide attributes" do
changeset = User.changeset(%User{}, @valid_attrs)
defmodule Catcasts.Repo.Migrations.AddUsers do
use Ecto.Migration
def change do
create table(:users) do
add :first_name, :string
add :last_name, :string
add :email, :string
add :provider, :string
add :token, :string