diff --git a/app/presenters/profile_presenter.rb b/app/presenters/profile_presenter.rb index 181575a9f..efc276163 100644 --- a/app/presenters/profile_presenter.rb +++ b/app/presenters/profile_presenter.rb @@ -65,7 +65,7 @@ class ProfilePresenter < BasePresenter def added_details_api_json { - birthday: formatted_birthday, + birthday: birthday.try(:iso8601), gender: gender, location: location_message.plain_text_for_json, bio: bio_message.plain_text_for_json diff --git a/spec/integration/api/users_controller_spec.rb b/spec/integration/api/users_controller_spec.rb index 4d6e5cef2..f2e0fef54 100644 --- a/spec/integration/api/users_controller_spec.rb +++ b/spec/integration/api/users_controller_spec.rb @@ -191,7 +191,7 @@ describe Api::V1::UsersController do context "Full with all valid fields" do it "succeeds" do new_bio = "new bio" - new_birthday = Time.current + 8_640_000 + new_birthday = Date.current + 100 new_gender = "ask1" new_location = "new location" new_first_name = "new first" @@ -220,7 +220,7 @@ describe Api::V1::UsersController do user = response_body(response) confirm_self_data_format(user) expect(user["bio"]).to eq(new_bio) - expect(user["birthday"]).to eq(birthday_format(new_birthday)) + expect(user["birthday"]).to eq(new_birthday.iso8601) expect(user["location"]).to eq(new_location) expect(user["gender"]).to eq(new_gender) expect(user["first_name"]).to eq(new_first_name)