Fix post controller test
This commit is contained in:
parent
5326ddf6c3
commit
758c673f68
1 changed files with 5 additions and 3 deletions
|
|
@ -109,16 +109,18 @@ describe Api::V1::PostsController do
|
||||||
).to eq(true)
|
).to eq(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "creates a private post" do
|
it "or creates a private post" do
|
||||||
|
aspect = Aspect.find_by(user_id: auth_with_read_and_write.user.id)
|
||||||
post(
|
post(
|
||||||
api_v1_posts_path,
|
api_v1_posts_path,
|
||||||
params: {
|
params: {
|
||||||
access_token: access_token_with_read_and_write,
|
access_token: access_token_with_read_and_write,
|
||||||
status_message: {text: "Hello this is a post!"},
|
status_message: {text: "Hello this is a post!"},
|
||||||
aspect_ids: "1"
|
aspect_ids: [aspect.id]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
expect(Post.find_by(text: "Hello this is a post!").public).to eq(false)
|
posted_post = Post.find_by(text: "Hello this is a post!")
|
||||||
|
expect(posted_post.public).to eq(false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue