     test "renders errors when data is invalid", %{conn: conn} do
       conn = post conn, user_path(conn, :create), @invalid_attrs
       assert json_response(conn, 422)["errors"] != %{}
-    end end
+    end
+  end
 
   describe "update user" do
     setup [:create_user]

      assert %{"users" => users} = json_response(conn, 200)["data"]
      is_the_same_users(users, [admin])
    end
  end

  describe "create user" do

        # "email" => @update_attrs.email,
    end

    test "not renders user when data is valid and users are not the same", %{conn: conn, user: %User{id: id} = user} do
      {:ok, %User{} = user2} = Accounts.create_user(@create_attrs2)
      conn = Boilerplate.Accounts.sign_in_user(conn, user2)
      new_conn = put conn, user_path(conn, :update, user), user: @update_attrs
      assert json_response(new_conn, 403)

      conn = get conn, user_path(conn, :show, id, %{"username" => @create_attrs.username})
      assert json_response(conn, 200)["data"] == %{
        "id" => id,
        "name" => @create_attrs.name,
        "username" => @create_attrs.username}
        # "email" => @update_attrs.email,
    end

    test "not renders user when data is valid and user are not authorised", %{conn: conn, user: %User{id: id} = user} do
      new_conn = put conn, user_path(conn, :update, user), user: @update_attrs
      assert json_response(new_conn, 401)["errors"]

      conn = Boilerplate.Accounts.sign_in_user(conn, user)
      conn = get conn, user_path(conn, :show, id, %{"username" => @create_attrs.username})
      assert json_response(conn, 200)["data"] == %{
        "id" => id,
