Browse Source

Add another test

tags/v0.2.2.0
Peter J. Jones 4 years ago
parent
commit
ea89aef41d
1 changed files with 11 additions and 0 deletions
  1. 11
    0
      test/MovieTest.hs

+ 11
- 0
test/MovieTest.hs View File

@@ -19,6 +19,16 @@ testSearchMovie = do
movies <- fakeTMDB "test/search-good.json" (searchMovies T.empty)
assertEqual "length" 8 (length movies)

--------------------------------------------------------------------------------
testMoviePosterURLs :: Assertion
testMoviePosterURLs = do
cfg <- fakeTMDB "test/config-good.json" config
movie <- fakeTMDB "test/movie-good.json" (fetchMovie 0)
let urls = moviePosterURLs cfg movie
poster = "http://cf2.imgobject.com/t/p/w92/pTpxQB1N0waaSc3OSn0e9oc8kx9.jpg"
assertEqual "length" 6 (length urls)
assertEqual "url" poster (head urls)

--------------------------------------------------------------------------------
goodMovieFieldsTest :: Assertion
goodMovieFieldsTest = do
@@ -59,4 +69,5 @@ tests = testGroup "Movies"
, testCase "Failure with bad JSON" badMovieJSONTest
, testCase "Propagate network failure" shouldHaveNetworkErrorTest
, testCase "Searching movies" testSearchMovie
, testCase "Movie poster URLs" testMoviePosterURLs
]

Loading…
Cancel
Save