-
Notifications
You must be signed in to change notification settings - Fork 102
Change jurisdiction column to jurisdiction_type in agencies table fixes#1343 #1496
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
Change jurisdiction column to jurisdiction_type in agencies table fixes#1343 #1496
Conversation
|
@rachaelkiteme can you add a spec to make sure that if an agency is created with a random jurisidiction type that's not listed, that it gets flagged as invalid? |
|
okay will do that
Regards
Rachael
…On Thu, May 10, 2018 at 6:58 AM, Rachel Green ***@***.***> wrote:
Ah, and one last thing before I forget - can you rename
spec/factories/agencies.rb to spec/factories/agency.rb?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1496 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AP8h5Jpa60D7mX85g-fOAs-oBvUxhW9gks5tw7rMgaJpZM4T2YwT>
.
|
|
Am trying to go through some tutorials on rspec but am not really getting
the concept so well, would you mind helping me on how to add the spec?
Regards
Rachael
On Thu, May 10, 2018 at 9:55 AM, Rachael Kiteme <rachaelrirrie@gmail.com>
wrote:
… okay will do that
Regards
Rachael
On Thu, May 10, 2018 at 6:58 AM, Rachel Green ***@***.***>
wrote:
> Ah, and one last thing before I forget - can you rename
> spec/factories/agencies.rb to spec/factories/agency.rb?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#1496 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AP8h5Jpa60D7mX85g-fOAs-oBvUxhW9gks5tw7rMgaJpZM4T2YwT>
> .
>
|
|
@rachaelkiteme No worries. So what I mean is that I want you to add a test where, if we try to create an agency with some random jurisdiction listed, like If you look at the test ensuring that an agency has a name, that should provide you with a good example. If you do need to update the |
…s to validate jurisdiction type
…_jurisdiction_enum_to_jurisdiction_type_#1343
…ttps://github.com/EBWiki/EBWiki into change_jurisdiction_enum_to_jurisdiction_type_#1343
|
Hey, so this looks good, but what I was looking for was kind of the opposite - that if you tried to create an agency with an invalid jurisdiction type, that it would fail. Can you change that? Also, can you add a feature spec that does the same thing? We might as well go ahead and add it now. Also, I'll check Travis and see what's going on. So it's saying that the |
|
Hey! So, three quick notes: first, I figured out why Travis is complaining - we have two Anyways, that factory change should get Travis to work. Let me know if it doesn't. |
|
Hello, Should I get rid of validation in agency.rb?
Regards
Rachael
…On Wed, May 23, 2018 at 9:14 AM, Rachel Green ***@***.***> wrote:
Hey! So, three quick notes: first, I figured out why Travis is complaining
- we have two agency factories. You have both a spec/factories/agencies.rb
and a spec/factory/agency.rb. They seem identical to me, so just delete
one of them, doesn't matter which. Second, having a jurisdiction type isn't
required for an agency to be valid - we just need to make sure that if the
user enters one it's a valid type. You can keep the tests for it having a
valid jurisdiction type, just get rid of the ones that require it to have a
jurisdiction type to be a valid object. Third, these are enumerables, so
rather than list each jurisdiction type like %w [none, local, state,
federal, university] you can just use JurisdictionType.entries.
Anyways, that factory change should get Travis to work. Let me know if it
doesn't.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1496 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AP8h5PlOVTtEYwligyhmH1px0fId_6Ncks5t1P5igaJpZM4T2YwT>
.
|
|
You can keep the validation, just set it so that it can be |
|
Had to use |
|
Huh, that's weird. Not sure why that wouldn't work, given that's what the gem's author says to do. Anyways, in You can also get rid of the changes you made to the test That's pretty much it; I'll merge whenever those changes are made. Thanks for tackling this. Some of this is wrangling with tests in the hopes that it'll be easier later on. |
|
Wow at last! now have an idea of what tests are. Thank you
Regards
Rachael
On Mon, Jun 11, 2018 at 6:10 AM, Rachel Green ***@***.***> wrote:
Merged #1496 <#1496>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1496 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AP8h5H8IIksvRuCulCbXd9855Tal3SW2ks5t7d_DgaJpZM4T2YwT>
.
Regards
Rachael
…On Mon, Jun 11, 2018 at 6:10 AM, Rachel Green ***@***.***> wrote:
Merged #1496 <#1496>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1496 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AP8h5H8IIksvRuCulCbXd9855Tal3SW2ks5t7d_DgaJpZM4T2YwT>
.
|
|
Yeah, thanks for sticking with this. Testing is tricky - it really takes some time to grok how testing should go. I think our repo is a bit misleading, because it says we have a really high test coverage, but when you actually look at the tests themselves there's a bunch of stuff we don't account for. Case in point - I'm going to assign you to an issue because I forgot a step in this whole process, and better testing would have caught it. |
In your PR did you: