   test "the page shows a post", %{session: session} do
     developer = Factory.insert!(:developer)
     channel = Factory.insert!(:channel, name: "command-line")
-    post = Factory.insert!(:post,
-      title: "A special post",
-      body: "This is how to be super awesome!",
-      developer: developer,
-      channel: channel
-    )
+
+    post =
+      Factory.insert!(
+        :post,
+        title: "A special post",
+        body: "This is how to be super awesome!",
+        developer: developer,
+        channel: channel
+      )
 
     session
     |> PostShowPage.navigate(post)


  test "sees raw markdown version", %{session: session} do
    title = "A special post"
    body = """
    # title
    **some text**
    [hashrocket](http://hashrocket.com)
    """
    developer = Factory.insert!(:developer)
    post = Factory.insert!(:post,
                           title: title,
                           body: body,
                           developer: developer)

    session
    |> visit("#{post_path(Endpoint, :show, post)}.md")

    assert text(session) == String.trim("""
    #{title}

    #{body}

    #{developer.username}
    #{TilexWeb.SharedView.display_date(post)}
    """)
  end

  test "via the random url", %{session: session} do


  test "and sees a special slug", %{session: session} do
    post = Factory.insert!(:post, title: "Super Sluggable Title")

    url =
      session
      |> visit(post_path(Endpoint, :show, post))
      |> current_url

    assert url =~ "#{post.slug}-super-sluggable-title"

    changeset = Post.changeset(post, %{title: "Alternate Also Cool Title"})
    Repo.update!(changeset)
    post = Repo.get(Post, post.id)

    url =
      session
      |> visit(post_path(Endpoint, :show, post))
      |> current_url

    assert url =~ "#{post.slug}-alternate-also-cool-title"
  end

  test "and sees a channel specific twitter card and a post specific twitter description", %{
    session: session
  } do
    popular_channel = Factory.insert!(:channel, name: "command-line")

    post =
      Factory.insert!(
        :post,
        channel: popular_channel,
        body: "One sentence that sets up the post.\nAnother sentence that is more informative"
      )

    image_url =
      session
      |> visit(post_path(Endpoint, :show, post))
      |> find(Query.css("meta[name='twitter:image']", visible: false))
      |> Element.attr("content")

    assert image_url =~ "command_line_twitter_card.png"

    twitter_description =
      session
      |> find(Query.css("meta[name='twitter:description']", visible: false))
      |> Element.attr("content")

    assert twitter_description =~ "One sentence that sets up the post."
    refute twitter_description =~ "Another sentence"
