Skip to content

Commit d7a854a

Browse files
author
installer
committed
https://github.com/rspec/rspec-rails/pull/2765
1 parent 0dbbd0f commit d7a854a

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

spec/api/v1/base_create/create_card_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,23 @@
3939

4040
before { make_request }
4141

42-
it("return unprocessable_entity status") { expect(response).to have_http_status(:unprocessable_entity) }
42+
it("return unprocessable_content status") { expect(response).to have_http_status(:unprocessable_content) }
4343
it("doesn't success") { expect(json_body).to include(success: false) }
4444
it("returns error") { expect(json_body).to include(errors: hash_including(amount: ["must be greater than 0"])) }
4545
end
4646

4747
context "when user_id is blank" do
4848
before { buy(shop_id: shop[:id], user_id: nil, amount: amount, use_bonuses: use_bonuses) }
4949

50-
it("return unprocessable_entity status") { expect(response).to have_http_status(:unprocessable_entity) }
50+
it("return unprocessable_content status") { expect(response).to have_http_status(:unprocessable_content) }
5151
it("doesn't success") { expect(json_body).to include(success: false) }
5252
it("returns error") { expect(json_body).to include(errors: hash_including(user_id: ["is required"])) }
5353
end
5454

5555
context "when amount is blank" do
5656
before { buy(shop_id: shop[:id], user_id: user[:id], amount: nil, use_bonuses: use_bonuses) }
5757

58-
it("return unprocessable_entity status") { expect(response).to have_http_status(:unprocessable_entity) }
58+
it("return unprocessable_content status") { expect(response).to have_http_status(:unprocessable_content) }
5959
it("doesn't success") { expect(json_body).to include(success: false) }
6060
it("returns error") { expect(json_body).to include(errors: hash_including(amount: ["is required"])) }
6161
end

spec/api/v1/base_create/create_shop_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
let(:name) { "" }
2525
let(:expected_error) {
2626
{
27-
code: "unprocessable_entity",
27+
code: "unprocessable_content",
2828
status: "422",
2929
title: "Validation Error",
3030
detail: "Name can't be blank",
@@ -38,7 +38,7 @@
3838
it 'return jsonapi error' do
3939
make_request
4040

41-
expect(response).to have_http_status(:unprocessable_entity)
41+
expect(response).to have_http_status(:unprocessable_content)
4242
expect(json_body[:errors].first).to include(expected_error)
4343
end
4444
end
@@ -48,7 +48,7 @@
4848

4949
let(:expected_error) {
5050
{
51-
code: "unprocessable_entity",
51+
code: "unprocessable_content",
5252
status: "422",
5353
title: "Validation Error",
5454
detail: "Name has already been taken",
@@ -63,7 +63,7 @@
6363
make_request
6464

6565
aggregate_failures "testing response" do
66-
expect(response).to have_http_status(:unprocessable_entity)
66+
expect(response).to have_http_status(:unprocessable_content)
6767
expect(json_body[:errors].first).to include(expected_error)
6868
end
6969
end

spec/api/v1/base_create/create_user_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
let(:email) { "" }
2626
let(:expected_error) {
2727
{
28-
code: "unprocessable_entity",
28+
code: "unprocessable_content",
2929
status: "422",
3030
title: "Validation Error",
3131
detail: "Email can't be blank",
@@ -39,7 +39,7 @@
3939
it 'return jsonapi error' do
4040
make_request
4141

42-
expect(response).to have_http_status(:unprocessable_entity)
42+
expect(response).to have_http_status(:unprocessable_content)
4343
expect(json_body[:errors].first).to include(expected_error)
4444
end
4545
end
@@ -49,7 +49,7 @@
4949

5050
let(:expected_error) {
5151
{
52-
code: "unprocessable_entity",
52+
code: "unprocessable_content",
5353
status: "422",
5454
title: "Validation Error",
5555
detail: "Email has already been taken",
@@ -64,7 +64,7 @@
6464
make_request
6565

6666
aggregate_failures "testing response" do
67-
expect(response).to have_http_status(:unprocessable_entity)
67+
expect(response).to have_http_status(:unprocessable_content)
6868
expect(json_body[:errors].first).to include(expected_error)
6969
end
7070
end

spec/api/v1/base_update/update_shop_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
let(:new_name) { "" }
4242
let(:expected_error) {
4343
{
44-
code: "unprocessable_entity",
44+
code: "unprocessable_content",
4545
status: "422",
4646
title: "Validation Error",
4747
detail: "Name can't be blank",
@@ -56,7 +56,7 @@
5656
make_request
5757

5858
aggregate_failures "testing response" do
59-
expect(response).to have_http_status(:unprocessable_entity)
59+
expect(response).to have_http_status(:unprocessable_content)
6060
expect(json_body[:errors].first).to include(expected_error)
6161
end
6262
end
@@ -67,7 +67,7 @@
6767

6868
let(:expected_error) {
6969
{
70-
code: "unprocessable_entity",
70+
code: "unprocessable_content",
7171
status: "422",
7272
title: "Validation Error",
7373
detail: "Name has already been taken",
@@ -82,7 +82,7 @@
8282
make_request
8383

8484
aggregate_failures "testing response" do
85-
expect(response).to have_http_status(:unprocessable_entity)
85+
expect(response).to have_http_status(:unprocessable_content)
8686
expect(json_body[:errors].first).to include(expected_error)
8787
end
8888
end

spec/api/v1/base_update/update_user_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
let(:new_email) { "" }
4242
let(:expected_error) {
4343
{
44-
code: "unprocessable_entity",
44+
code: "unprocessable_content",
4545
status: "422",
4646
title: "Validation Error",
4747
detail: "Email can't be blank",
@@ -55,7 +55,7 @@
5555
it 'return jsonapi error' do
5656
make_request
5757

58-
expect(response).to have_http_status(:unprocessable_entity)
58+
expect(response).to have_http_status(:unprocessable_content)
5959
expect(json_body[:errors].first).to include(expected_error)
6060
end
6161
end
@@ -65,7 +65,7 @@
6565

6666
let(:expected_error) {
6767
{
68-
code: "unprocessable_entity",
68+
code: "unprocessable_content",
6969
status: "422",
7070
title: "Validation Error",
7171
detail: "Email has already been taken",
@@ -79,7 +79,7 @@
7979
it 'return jsonapi error' do
8080
make_request
8181

82-
expect(response).to have_http_status(:unprocessable_entity)
82+
expect(response).to have_http_status(:unprocessable_content)
8383
expect(json_body[:errors].first).to include(expected_error)
8484
end
8585
end

0 commit comments

Comments
 (0)