diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,7 @@
+## 1.6.4
+Add yesodSpecWithSiteGeneratorAndArgument
+[#1485](https://github.com/yesodweb/yesod/pull/1485)
+
 ## 1.6.3
 Add performMethod
 [#1502](https://github.com/yesodweb/yesod/pull/1502)
diff --git a/Yesod/Test.hs b/Yesod/Test.hs
--- a/Yesod/Test.hs
+++ b/Yesod/Test.hs
@@ -34,6 +34,7 @@
       yesodSpec
     , YesodSpec
     , yesodSpecWithSiteGenerator
+    , yesodSpecWithSiteGeneratorAndArgument
     , yesodSpecApp
     , YesodExample
     , YesodExampleData(..)
@@ -274,12 +275,23 @@
                            => IO site
                            -> YesodSpec site
                            -> Hspec.Spec
-yesodSpecWithSiteGenerator getSiteAction yspecs =
+yesodSpecWithSiteGenerator getSiteAction =
+    yesodSpecWithSiteGeneratorAndArgument (const getSiteAction)
+
+-- | Same as yesodSpecWithSiteGenerator, but also takes an argument to build the site
+-- and makes that argument available to the tests.
+--
+-- @since 1.6.4
+yesodSpecWithSiteGeneratorAndArgument :: YesodDispatch site
+                           => (a -> IO site)
+                           -> YesodSpec site
+                           -> Hspec.SpecWith a
+yesodSpecWithSiteGeneratorAndArgument getSiteAction yspecs =
     Hspec.fromSpecList $ map (unYesod getSiteAction) $ execWriter yspecs
     where
       unYesod getSiteAction' (YesodSpecGroup x y) = Hspec.specGroup x $ map (unYesod getSiteAction') y
-      unYesod getSiteAction' (YesodSpecItem x y) = Hspec.specItem x $ do
-        site <- getSiteAction'
+      unYesod getSiteAction' (YesodSpecItem x y) = Hspec.specItem x $ \a -> do
+        site <- getSiteAction' a
         app <- toWaiAppPlain site
         evalSIO y YesodExampleData
             { yedApp = app
diff --git a/yesod-test.cabal b/yesod-test.cabal
--- a/yesod-test.cabal
+++ b/yesod-test.cabal
@@ -1,5 +1,5 @@
 name:               yesod-test
-version:            1.6.3
+version:            1.6.4
 license:            MIT
 license-file:       LICENSE
 author:             Nubis <nubis@woobiz.com.ar>
