Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit f449a1c

Browse files
committed
refactor(create-article): fix article_tags tests edge case
1 parent a306744 commit f449a1c

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

test/groupher_server/cms/article_tags/blog_tag_test.exs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ defmodule GroupherServer.Test.CMS.ArticleTag.BlogTag do
9999
{:ok, article_tag} = CMS.create_article_tag(community, :blog, article_tag_attrs, user)
100100
{:ok, article_tag2} = CMS.create_article_tag(community2, :blog, article_tag_attrs2, user)
101101

102-
blog_with_tags =
103-
Map.merge(blog_attrs, %{article_tags: [%{id: article_tag.id}, %{id: article_tag2.id}]})
102+
blog_with_tags = Map.merge(blog_attrs, %{article_tags: [article_tag.id, article_tag2.id]})
104103

105104
{:error, reason} = CMS.create_article(community, :blog, blog_with_tags, user)
106105
is_error?(reason, :invalid_domain_tag)

test/groupher_server/cms/article_tags/job_tag_test.exs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ defmodule GroupherServer.Test.CMS.ArticleTag.JobTag do
9999
{:ok, article_tag} = CMS.create_article_tag(community, :job, article_tag_attrs, user)
100100
{:ok, article_tag2} = CMS.create_article_tag(community2, :job, article_tag_attrs2, user)
101101

102-
job_with_tags =
103-
Map.merge(job_attrs, %{article_tags: [%{id: article_tag.id}, %{id: article_tag2.id}]})
102+
job_with_tags = Map.merge(job_attrs, %{article_tags: [article_tag.id, article_tag2.id]})
104103

105104
{:error, reason} = CMS.create_article(community, :job, job_with_tags, user)
106105
is_error?(reason, :invalid_domain_tag)

test/groupher_server/cms/article_tags/post_tag_test.exs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ defmodule GroupherServer.Test.CMS.ArticleTag.PostTag do
9999
{:ok, article_tag} = CMS.create_article_tag(community, :post, article_tag_attrs, user)
100100
{:ok, article_tag2} = CMS.create_article_tag(community2, :post, article_tag_attrs2, user)
101101

102-
post_with_tags =
103-
Map.merge(post_attrs, %{article_tags: [%{id: article_tag.id}, %{id: article_tag2.id}]})
102+
post_with_tags = Map.merge(post_attrs, %{article_tags: [article_tag.id, article_tag2.id]})
104103

105104
{:error, reason} = CMS.create_article(community, :post, post_with_tags, user)
106105
is_error?(reason, :invalid_domain_tag)

test/groupher_server/cms/article_tags/repo_tag_test.exs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ defmodule GroupherServer.Test.CMS.ArticleTag.RepoTag do
9999
{:ok, article_tag} = CMS.create_article_tag(community, :repo, article_tag_attrs, user)
100100
{:ok, article_tag2} = CMS.create_article_tag(community2, :repo, article_tag_attrs2, user)
101101

102-
repo_with_tags =
103-
Map.merge(repo_attrs, %{article_tags: [%{id: article_tag.id}, %{id: article_tag2.id}]})
102+
repo_with_tags = Map.merge(repo_attrs, %{article_tags: [article_tag.id, article_tag2.id]})
104103

105104
{:error, reason} = CMS.create_article(community, :repo, repo_with_tags, user)
106105
is_error?(reason, :invalid_domain_tag)

0 commit comments

Comments
 (0)