Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix emoji #49

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions priv/repo/migrations/20170717094445_update_posting_text.exs
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions test/controllers/posting_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down