updates specs to new keyword styles

This commit is contained in:
Juanjo Bazán
2017-06-16 13:14:41 +02:00
committed by Julian Herrero
parent b62eff841c
commit 0f34cae2ad
4 changed files with 64 additions and 57 deletions

View File

@@ -14,7 +14,7 @@ describe CommentsController do
sign_in @user
expect do
xhr :post, :create, comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"}
post :create, params: {comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"}}, xhr: true
end.to change { @question.reload.comments_count }.by(1)
end
@@ -23,7 +23,7 @@ describe CommentsController do
@process.update_attribute(:debate_end_date, Date.current - 1.day)
expect do
xhr :post, :create, comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"}
post :create, params: {comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"}}, xhr: true
end.not_to change { @question.reload.comments_count }
end
@@ -31,7 +31,7 @@ describe CommentsController do
sign_in @unverified_user
expect do
xhr :post, :create, comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"}
post :create, params: {comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"}}, xhr: true
end.not_to change { @question.reload.comments_count }
end
end