-import Ecto.DateTime
-
 defmodule Features.VisitorViewsStatsTest do
   use Tilex.IntegrationCase, async: true
 

      "Templates",
    ]

    channel = Factory.insert!(:channel, name: "phoenix")

    posts
    |> Enum.with_index

    Factory.insert!(:post, title: "Vim rules", inserted_at: dt.(Date.to_erl(previous_wednesday)))

    visit(session, "/statistics")
    activity_tag = find(session, css("ul#activity"))

    find(activity_tag,
         css("li[data-amount='1'][data-date='Mon, #{Timex.format!(previous_monday, "%b %e", :strftime)}']")
       )
    find(activity_tag,
         css("li[data-amount='2'][data-date='Tue, #{Timex.format!(previous_tuesday, "%b %e", :strftime)}']")
       )
    find(activity_tag,
         css("li[data-amount='3'][data-date='Wed, #{Timex.format!(previous_wednesday, "%b %-e", :strftime)}']")
        )
  end
end
