Skip to content
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

187434149 flow to create user #42

Merged
merged 4 commits into from
Apr 23, 2024
Merged

187434149 flow to create user #42

merged 4 commits into from
Apr 23, 2024

Conversation

Sep26
Copy link

@Sep26 Sep26 commented Apr 22, 2024

General Info

Changes

Explain your changes here (in such a way that you would understand why you made them a year from now).
I set up the create user flow along with rspec test

Testing

Explain how you tested your changes. If testing is not necessary, explain why.

Documentation

Does this PR require documentation. If so, explain where it can be found.

Checklist

  • Name of branch corresponds to story

app/models/user.rb Outdated Show resolved Hide resolved
app/models/user.rb Outdated Show resolved Hide resolved
app/controllers/api/v1/users_controller.rb Outdated Show resolved Hide resolved
Copy link

@cynthia-lixinyi cynthia-lixinyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@Sep26 Sep26 merged commit 0c35b2d into main Apr 23, 2024
6 checks passed
@Sep26 Sep26 deleted the 187434149-flow-to-create-user branch April 23, 2024 21:52

# Relationship with LmsCredential
# Associasions

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Associations

has_many :lms_credentials, dependent: :destroy
has_many :user_to_courses

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a strange variable/class name, and isn't plural (which i'd expect for has_many). do you mean something like course_specific_users? it's worth taking time to think carefully about names, as once they are committed you're generally stuck with them

Copy link

@armandofox armandofox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, couple of minor comments inline.

it 'creates the user successfully' do
post :create, params: { email: '[email protected]' }

expect(response).to have_http_status(:created)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is nitpicking but: technically you should proabbly put the post in a before :each block and have the 3 expectations be separate specs, since each spec is supposed to test only 1 behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants