-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add valid_email & confirmed_at to /me-only attributes #4272
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Do we want to add a test on users_controller spec for #me
method tests?
Private attrs are specced out already here: panoptes/spec/serializers/user_serializer_spec.rb Lines 74 to 94 in 42e4ec1
The date comparison failed with a nanosecond-scale difference between the database & object values, hence the explicit setting of the confirmation attrs here. edit: ope misread controller as serializer, yeah I'll add one for the controller spec! |
…ptes into user-serializer-me-attrs
@@ -392,6 +392,12 @@ | |||
expect(result).to eq(user.upload_whitelist) | |||
end | |||
|
|||
it "should have the confirmed_at for the user" do | |||
result = user_response["confirmed_at"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
@@ -392,6 +392,12 @@ | |||
expect(result).to eq(user.upload_whitelist) | |||
end | |||
|
|||
it "should have the confirmed_at for the user" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
RSpec/ExampleWording: Do not use should when describing your tests.
Include User model attributes
valid_email
andconfirmed_at
in serialized user objects via the/me
route. These attributes can then be used to indicate an invalid email or that an email address needs confirmation on the user's profile/settings page.Review checklist
apiary.apib
file?