API: fix birthday format in responses
This commit is contained in:
parent
52e4e9f903
commit
91b6a807c7
2 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue