Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85712036
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/test/tesla/adapter/ibrowse_test.exs b/test/tesla/adapter/ibrowse_test.exs
index 9a2ff2d..2427297 100644
--- a/test/tesla/adapter/ibrowse_test.exs
+++ b/test/tesla/adapter/ibrowse_test.exs
@@ -1,33 +1,43 @@
defmodule IbrowseTest do
use ExUnit.Case
defmodule Client do
use Tesla.Builder
adapter :ibrowse
end
setup do
Application.ensure_started(:ibrowse)
:ok
end
+ test "basic get request" do
+ response = Client.get("http://httpbin.org/ip")
+ assert response.status == 200
+ end
+
+ test "basic post request" do
+ response = Client.post("http://httpbin.org/post", "some-post-data")
+ assert response.status == 200
+ assert Regex.match?(~r/some-post-data/, to_string(response.body))
+ end
test "async requests" do
{:ok, _id} = Client.get("http://httpbin.org/ip", respond_to: self)
assert_receive {:tesla_response, _}, 2000
end
test "async requests parameters" do
{:ok, _id} = Client.get("http://httpbin.org/ip", respond_to: self)
receive do
{:tesla_response, res} ->
assert res.status == 200
after
2000 -> raise "Timeout"
end
end
end
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Sep 19, 8:52 AM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1769218
Default Alt Text
(1 KB)
Attached To
Mode
R28 tesla
Attached
Detach File
Event Timeline
Log In to Comment