diff --git a/spec/controllers/api/v1/users_controller_spec.rb b/spec/controllers/api/v1/users_controller_spec.rb index 842c7e7fc..5190ecad0 100644 --- a/spec/controllers/api/v1/users_controller_spec.rb +++ b/spec/controllers/api/v1/users_controller_spec.rb @@ -561,7 +561,7 @@ def update_request it_behaves_like "an api response" end - context "with a an invalid put operation" do + context 'with an invalid put operation' do before(:each) { update_request } let(:put_operations) { {} } @@ -569,9 +569,11 @@ def update_request expect(response.status).to eq(422) end - it "should return a specific error message in the response body" do - error_message = json_error_message("param is missing or the value is empty: users") - expect(response.body).to eq(error_message) + it 'returns a specific error message in the response body' do + error_message = 'param is missing or the value is empty: users' + errors = JSON.parse(response.body)['errors'] + expect(errors).not_to be_empty + expect(errors[0]['message']).to include(error_message) end it "should not updated the resource attribute" do