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

Refactor applications controller spec #811

Closed
camillevilla opened this issue Feb 14, 2018 · 7 comments
Closed

Refactor applications controller spec #811

camillevilla opened this issue Feb 14, 2018 · 7 comments

Comments

@camillevilla
Copy link
Member

camillevilla commented Feb 14, 2018

Hi! Our application_controller_spec.rb has soo many tests. Yay! But it could take advantage of some shared examples, let statements, etc. This could make the code less repetitive and easier to read if you're not familiar with the file.

The wonderful @whyderrick has offered to help out with this effort. If anyone is interested in pairing and/or doing some analysis and splitting up work, comment here or on the #dev channel on Slack.

@asquare14
Copy link
Member

I want to work on this !

@whyderrick
Copy link

@asquare14 hey Atibhi! I'll be working on this tomorrow, but I'm in SF so it'll be sometime between 00:00 and 7:00 Bangalore time. It might be tough to pair, but I'd love for you to do the code review or to pick up on it if I don't finish tomorrow.

@asquare14
Copy link
Member

@whyderrick That would be cool! 😊

@asquare14
Copy link
Member

@whyderrick What is the progress?

@camillevilla camillevilla changed the title Refactor applications controller Refactor applications controller spec Jun 2, 2018
@vildevev
Copy link
Collaborator

vildevev commented Jun 2, 2018

Hi, I'm willing to work on this issue @camillevilla

@camillevilla
Copy link
Member Author

camillevilla commented Jun 2, 2018

@vildevev did a great job of starting this refactor (see #900). We now have some shared examples (let and before) blocks that folks can try using.

Other ideas for refactoring:

  • move additional variables into shared examples with let
    • mood
    • category
    • moment
    • strategy
    • new_allies
  • extract helpers to another file (e.g. make creating + sign_in user a single method)
  • find a DRYer way to create categories that have similar values. Is there a shorter way to create new_category1, new_category2 etc. when they all have the same userid?

Notes: Folks should feel free to claim one of these items by commenting on this issue. I highly recommend picking one bullet point and submitting a small PR first. It's better to move a little work forward than to take on the whole thing.

@StaphSynth
Copy link
Member

StaphSynth commented Jul 23, 2018

Just letting people know, I'm currently working on refactoring these tests.

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

No branches or pull requests

6 participants