Created
December 4, 2016 11:36
-
-
Save defndaines/8bdc89b4d4b4a9c3e9370b73b0f7b65e to your computer and use it in GitHub Desktop.
Elixir test case with variable warning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test "inserting movies is idempotent" do | |
| movie_map = %{"title" => "The Goonies", | |
| "short_title" => "goonies", | |
| "year" => 1985, | |
| "country" => "U.S."} | |
| movie = Store.insert_movie(movie_map) | |
| movie_list = Eiga.Movie |> select([movie], movie.title) |> Eiga.Repo.all | |
| assert Enum.find(movie_list, &(&1 == movie_map["title"])) | |
| movie = Store.insert_movie(movie_map) | |
| assert Enum.filter(movie_list, &(&1 == movie_map["title"])) == [Enum.find(movie_list, &(&1 == movie_map["title"]))] | |
| Eiga.Repo.delete(movie) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment