This repository has been archived by the owner on Nov 6, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 70
RSpec Hero 3: Legends of RSpec #51
Comments
Closed
fv42wid
added a commit
to fv42wid/partner
that referenced
this issue
Dec 13, 2018
seanmarcia
pushed a commit
that referenced
this issue
Dec 15, 2018
seanmarcia
added a commit
that referenced
this issue
Dec 22, 2018
WIP Add partners controller specs #51
@armahillo I wonder how many of these tasks we've completed with the referenced PRs? |
I'm at Ruby by the Bay, and just completed an audit of this issue by looking at the current code. Here's what still needs to be done: Servicesdiaper_bank_client_spec.rbThese need additional tests, but it will be hard to test them without the guard clause stopping non-Prod
Controllerspartners_controller_spec.rb(Note: html specs seem implemented; but not Json)
APIpartners_controller_spec.rb(note: not sure if implemented..
|
This was referenced Mar 30, 2019
1 task
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Expand the RSpec suite.
Push up a PR mentioning (but not closing / fixing, unless it really does finish the issue) this issue, then check off the ones you've done.
Configuration
FactoryBot
(eg.FactoryBot.build(...)
)--require spec_helper
with--require rails_helper
in/.rspec
Models
partner_request_spec.rb
approve_me
changes the partner_statusapprove_me
posts to the target DiaperBank (will need to stub the request)Services
diaper_bank_client_spec.rb
These need additional tests, but it will be hard to test them without the guard clause stopping non-Prod
post_request
prepares a Post objectpost_request
sets the X-Api-KeyControllers
The "requires authentication" specs can probably be a shared example.
partner_requests_controller_spec.rb
:index
is invalid without authentication:new
is invalid without authentication:create
is invalid without authentication:show
is invalid without authenticationapi_controller_spec.rb
Should this be marked as an abstract class?
partners_controller_spec.rb
:index
is invalid without authentication:new
is invalid without authentication:create
is invalid without authentication:show
is invalid without authentication:edit
is invalid without authentication:update
is invalid without authentication:approve
is invalid without authentication:destroy
is invalid without authentication:index
is successful:show
is successful:new
is successful:edit
is successful:approve
is successful (be sure to stub the post from DiaperBankClient):create
is successful via HTML:create
is successful via JSON:update
is successful via HTML:update
is successful via JSONstatic_controller_spec.rb
:index
is successful:page
is successful (you'll have to get creative with this one)API
partners_controller_spec.rb
:create
returns:forbidden
if the API key is invalid:create
is successful:update
returns:forbidden
if the API key is invalid:update
is successful:show
returns:forbidden
if the API key is invalid:show
is successfulFeatures
TBA
The text was updated successfully, but these errors were encountered: