From 4370315d6c02c031eed25c062e430a6691a78ff1 Mon Sep 17 00:00:00 2001 From: Frank Rousseau Date: Thu, 5 Jul 2018 18:17:27 +0200 Subject: [PATCH] Fix post controller test --- spec/integration/api/posts_controller_spec.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/integration/api/posts_controller_spec.rb b/spec/integration/api/posts_controller_spec.rb index 3d47ea5a7..8bead8c4f 100644 --- a/spec/integration/api/posts_controller_spec.rb +++ b/spec/integration/api/posts_controller_spec.rb @@ -109,16 +109,18 @@ describe Api::V1::PostsController do ).to eq(true) 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( api_v1_posts_path, params: { access_token: access_token_with_read_and_write, 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