Skip to content

Commit

Permalink
Fix and remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
joshsmith committed Nov 20, 2016
1 parent c8d195d commit b482efd
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 19 deletions.
3 changes: 0 additions & 3 deletions test/controllers/comment_controller_test.exs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
defmodule CodeCorps.CommentControllerTest do
use CodeCorps.ApiCase, resource_name: :comment

alias CodeCorps.Comment
alias CodeCorps.Repo

@valid_attrs %{markdown: "I love elixir!"}
@invalid_attrs %{markdown: ""}

Expand Down
2 changes: 0 additions & 2 deletions test/controllers/preview_controller_test.exs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
defmodule CodeCorps.PreviewControllerTest do
use CodeCorps.ApiCase, resource_name: :preview

alias CodeCorps.Preview

@valid_attrs %{markdown: "A **strong** element"}

describe "create" do
Expand Down
8 changes: 1 addition & 7 deletions test/controllers/stripe_customer_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@ defmodule CodeCorps.StripeCustomerControllerTest do
describe "create" do
@tag :authenticated
test "creates and renders resource user is authenticated and authorized", %{conn: conn, current_user: current_user} do
{:ok, datetime} = DateTime.from_unix(1479472835)
attrs = %{
created: datetime,
user: current_user
}
IO.inspect datetime
assert conn |> request_create(attrs) |> json_response(201)
assert conn |> request_create(%{user: current_user}) |> json_response(201)
end

test "does not create resource and renders 401 when unauthenticated", %{conn: conn} do
Expand Down
6 changes: 3 additions & 3 deletions test/controllers/task_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ defmodule CodeCorps.TaskControllerTest do
test "lists all entries newest first", %{conn: conn} do
# Has to be done manually. Inserting as a list is too quick.
# Field lacks the resolution to differentiate.
task_1 = insert(:task, inserted_at: Ecto.DateTime.cast!("2000-01-15T00:00:10"))
task_2 = insert(:task, inserted_at: Ecto.DateTime.cast!("2000-01-15T00:00:20"))
task_3 = insert(:task, inserted_at: Ecto.DateTime.cast!("2000-01-15T00:00:30"))
task_1 = insert(:task, inserted_at: Timex.to_date({2000, 1, 1}))
task_2 = insert(:task, inserted_at: Timex.to_date({2000, 1, 2}))
task_3 = insert(:task, inserted_at: Timex.to_date({2000, 1, 3}))

path = conn |> task_path(:index)
json = conn |> get(path) |> json_response(200)
Expand Down
1 change: 0 additions & 1 deletion test/controllers/user_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ defmodule CodeCorps.UserControllerTest do

alias CodeCorps.User
alias CodeCorps.Repo
alias CodeCorps.SluggedRoute

@valid_attrs %{
email: "test@user.com",
Expand Down
3 changes: 0 additions & 3 deletions test/policies/stripe_customer_policy_test.exs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
defmodule CodeCorps.StripeCustomerPolicyTest do
use CodeCorps.PolicyCase

import CodeCorps.StripeCustomer
import CodeCorps.StripeCustomerPolicy, only: [show?: 2]

alias CodeCorps.StripeCustomer

describe "show?" do
test "returns true when user is an admin" do
user = build(:user, admin: true)
Expand Down

0 comments on commit b482efd

Please sign in to comment.