- conn = conn
- |> with_credentials(user.nickname, "test")
- |> post("/api/statuses/update.json", %{ status: "Nice meme." })
+ conn_with_creds = conn |> with_credentials(user.nickname, "test")
+ request_path = "/api/statuses/update.json"
+
+ error_response = %{"request" => request_path,
+ "error" => "Client must provide a 'status' parameter with a value."}
+ conn = conn_with_creds |> post(request_path)
+ assert json_response(conn, 400) == error_response
+
+ conn = conn_with_creds |> post(request_path, %{ status: "" })
+ assert json_response(conn, 400) == error_response
+
+ conn = conn_with_creds |> post(request_path, %{ status: " " })
+ assert json_response(conn, 400) == error_response