DEV: Change flakey posts controller spec (#12506)

This commit is contained in:
Mark VanLandingham 2021-03-24 11:20:38 -05:00 committed by GitHub
parent 371afc45e0
commit 26e1ae17c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -414,9 +414,11 @@ describe PostsController do
expect(response).to be_forbidden expect(response).to be_forbidden
end end
it "calls revise with valid parameters" do it "updates post's raw attribute" do
PostRevisor.any_instance.expects(:revise!).with(post.user, { raw: 'edited body' , edit_reason: 'typo' }, anything)
put "/posts/#{post.id}.json", params: update_params put "/posts/#{post.id}.json", params: update_params
expect(response.status).to eq(200)
expect(post.reload.raw).to eq(update_params[:post][:raw])
end end
it "extracts links from the new body" do it "extracts links from the new body" do