21 lines
538 B
Elixir
21 lines
538 B
Elixir
|
defmodule FeedUpdaterTest do
|
||
|
use ExUnit.Case, async: true
|
||
|
|
||
|
|
||
|
setup do
|
||
|
updater = start_supervised!(ElixirRss.FeedUpdater)
|
||
|
%{updater: updater}
|
||
|
end
|
||
|
|
||
|
|
||
|
test "defaults to empty map", %{updater: updater} do
|
||
|
assert ElixirRss.FeedUpdater.get_state(updater, "some_url") == nil
|
||
|
end
|
||
|
|
||
|
test "successful update", %{updater: updater} do
|
||
|
url = "https://rss.slashdot.org/Slashdot/slashdotMain"
|
||
|
assert ElixirRss.FeedUpdater.update(updater, url) == :ok
|
||
|
assert ElixirRss.FeedUpdater.get_state(updater, url) != nil
|
||
|
end
|
||
|
end
|