       "Templates",
     ]
 
-    channel = Factory.insert!(:channel, name: "phoenix")
+    Factory.insert!(:channel, name: "phoenix")
 
     posts
     |> Enum.with_index

    end)

    visit(session, "/statistics")
    channels = find(session, ".stats_column ul#channels")

    query = Wallaby.Query.css(".stats_column header", text: "5 posts in 2 channels")
    channels_header = find(session, query)
    assert(channels_header)

    [ other_channel, phoenix_channel ] = all(channels, "li")

    assert Wallaby.Browser.text(other_channel) =~ "#other\n3 posts"
    assert Wallaby.Browser.text(phoenix_channel) =~ "#phoenix\n1 post"
  end

  test "sees most liked tils", %{session: session} do

    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
