Quantcast
Channel: Assert pattern match in phoenix tests - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by Dogbert for Assert pattern match in phoenix tests

I'm not sure how concise you were expecting, but here's how to do the same thing in one less line of code:%Player{id: id, site_id: site_id} = insert(:player)assert [%Player{id: ^id}] =...

View Article



Assert pattern match in phoenix tests

I'm testing a phoenix/elixir application, and I find myself using something like the following an awful lot.player = insert(:player)assert [%Player{id: x}] = Players.site_players(player.site_id)assert...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images