Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

3 add tests to partner request spec - #12

Open
Randond wants to merge 12 commits into
masterfrom
3-add-tests-to-partner_request_spec
Open

3 add tests to partner request spec#12
Randond wants to merge 12 commits into
masterfrom
3-add-tests-to-partner_request_spec

Conversation

@Randond

@Randond Randond commented Feb 27, 2019

Copy link
Copy Markdown

All tests pass. Do I need to also test the conditions if the conditions are not met?

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes ("bundle exec rspec")
  • Title include "WIP" if work is in progress.

-->

Resolves #7

Description

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Documentation update

How Has This Been Tested?

Screenshots

Randond added 2 commits February 28, 2019 16:45

@mdworken mdworken left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is really close to being done I think! The main piece remaining is then attempting to modify the partner object to violate the assumptions and verify it's no longer valid. For example, for the third test, you may want to remove the documents and verify that valid? then returns false.

@Randond

Randond commented Mar 11, 2019

Copy link
Copy Markdown
Author

@mdworken are you saying I should change to code in the partner request model (see screenshot)l? Or should I simply test to see if the tests fail without editing the model?
Screenshot (12)

Comment thread spec/models/partner_request_spec.rb Outdated
end
end

describe "a partner must contain" do

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

describe blocks can contain multiple it blocks, so you don't need a second one here.

@Randond
Randond requested review from mdworken and nihonjinrxs March 12, 2019 16:40
@mdworken

Copy link
Copy Markdown
Collaborator

@Randond what I'm trying to get at is within the test you should change the attribute, then verify that .save fails. Happy to pair with you on this if it'd help :)

@nihonjinrxs

Copy link
Copy Markdown
Member

@Randond you'll need to re-merge master into this branch, as it's out of date now.

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.

3 participants