diff --git a/priv/repo/migrations/20170717094445_update_posting_text.exs b/priv/repo/migrations/20170717094445_update_posting_text.exs new file mode 100644 index 0000000..d91d2f1 --- /dev/null +++ b/priv/repo/migrations/20170717094445_update_posting_text.exs @@ -0,0 +1,10 @@ +defmodule ElixirStatus.Repo.Migrations.UpdatePostingText do + use Ecto.Migration + + def change do + alter table(:postings) do + modify :text, :"TEXT CHARACTER SET utf8mb4" + modify :title, :"TEXT CHARACTER SET utf8mb4" + end + end +end diff --git a/test/controllers/posting_controller_test.exs b/test/controllers/posting_controller_test.exs index 8a52a5e..4bbad84 100644 --- a/test/controllers/posting_controller_test.exs +++ b/test/controllers/posting_controller_test.exs @@ -54,6 +54,18 @@ defmodule ElixirStatus.PostingControllerTest do assert redirected_to(conn) == posting_path(conn, :index) end + @tag posting_create: true + test "creates resource and redirects when data is includes emojies", _ do + attrs_with_emoji = %{text: "🗜🐳📦 some [content](http://github.com/) on the [web](http://google.com/)", title: "🗜🐳📦 some content"} + conn = logged_in_conn() + conn = + conn + |> post(posting_path(conn, :create), posting: attrs_with_emoji) + + assert Repo.get_by(Posting, attrs_with_emoji) + assert redirected_to(conn) == posting_path(conn, :index) + end + @tag posting_create: true test "when NOT logged in -> does not create resource and renders errors when data is invalid", _ do