Skip to content
This repository has been archived by the owner on Nov 6, 2021. It is now read-only.

Add specs to partner requests controllers #175

Merged
merged 2 commits into from
Sep 20, 2019
Merged

Add specs to partner requests controllers #175

merged 2 commits into from
Sep 20, 2019

Conversation

cassianoblonski
Copy link
Contributor

Resolves #149

Description

Migrated the file partner_requests_controller_spec to spec/requests/partner_requests_spec, then added some new specs to improve coverage

Type of change

  • Improvement

How Has This Been Tested?

Running all RSpec tests.

@cassianoblonski cassianoblonski mentioned this pull request Aug 30, 2019
4 tasks
Copy link
Member

@benreyn benreyn left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution @cassianoblonski! I really appreciate it! 😄 I have some notes that are mostly personal preference. I know that much of this was copied over from the old controller_spec that these were ported from. I certainly wont consider it a blocker to merging.

@@ -0,0 +1 @@
ruby 2.6.2
Copy link
Member

Choose a reason for hiding this comment

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

I know this is for asdf version manager, but can't the asdf ruby plugin not use the same .ruby-version standard as rbenv, chruby, and rvm?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so, I tried searching this right now and didn't found a way. I don't like this either makes the root project folder kind of dirt with so many version manager files, but its good for obvious reasons, so we remove this file or keep it?

Copy link
Member

Choose a reason for hiding this comment

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

I dont really have a preference, just thought that we could avoid it, but id rather asdf users have a positive experience setting up the app.

Copy link
Member

Choose a reason for hiding this comment

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

Looks like there is a configuration flag you can set on your .asdfrc


RSpec.describe "Partner Requests Controller", type: :request do
context "when user authenticated" do
let!(:partner) { create(:partner, :verified) }
Copy link
Member

Choose a reason for hiding this comment

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

I tend to avoid the usage of let blocks in my rspec tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Once I get home, I’m going to check this blog post, thx for the tip I really appreciate your sharing.

let!(:partner) { create(:partner, :verified) }
let!(:user) { create(:user, partner: partner) }

before do
Copy link
Member

Choose a reason for hiding this comment

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

I prefer to avoid before blocks like this for the same reasons that I like to avoid let

@benreyn benreyn merged commit eed59dc into rubyforgood:master Sep 20, 2019
@cassianoblonski cassianoblonski deleted the add-specs-to-partner-requests-controllers branch December 2, 2019 05:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test Coverage: Partner Requests Controller
2 participants