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

399 duplicates #529

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open

399 duplicates #529

wants to merge 12 commits into from

Conversation

mi-wood
Copy link
Member

@mi-wood mi-wood commented Nov 18, 2018

This is just a slight refactor of the PR I merged to a local branch. Moving back to using (obj) syntax, because it seems like the methods aren't available in the if block.

@mi-wood
Copy link
Member Author

mi-wood commented Nov 18, 2018

Looks like we need to stub the geocode require that the if block creates. I don't have time to do this atm, but can get to it later. Also, not really sure if there's a better way to fix the ugly ->(obj) block syntax.

@@ -17,14 +17,17 @@ class Restroom < ApplicationRecord
using: {tsearch: {dictionary: "english"}},
ignoring: :accents

validates :name, :street, :city, :state, presence: true
if Rails.env != "test"
Copy link
Member Author

Choose a reason for hiding this comment

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

This does the trick for testing, but I don't like it. I think I'd rather fix the tests to truncate the db and simulate production better. We also need a test for the validation itself.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would we be able to "simulate production better" by having real database data from production? I would be able to update db/export.csv with actual, recent data as it exists in production, if that would help.

Copy link
Member Author

Choose a reason for hiding this comment

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

@DeeDeeG I think that would make sense. I'd like to also work on killing this conditional though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, also FYI. Changing the csv won't fix this issue. There's some sort of hook before the save that tries to geolocate these. I'm not sure what forces it to happen, but it is different than the uniqueness check.

)
restroom.save(validate: false)
Copy link
Member Author

Choose a reason for hiding this comment

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

Ignoring validation during seeding seems reasonable, since those don't really change ever.

@mi-wood
Copy link
Member Author

mi-wood commented Nov 24, 2018

This should also have a test for it. @tcmal do you think you could add one?

@tcmal
Copy link

tcmal commented Nov 24, 2018

Will do, in a fork or just put the patch on a gist?

@mi-wood
Copy link
Member Author

mi-wood commented Nov 24, 2018

Fork and a PR into this branch would be great! Sorry if I made that a pain. It’s tough to work on multiple forks.

@DeeDeeG

This comment has been minimized.

@DeeDeeG

This comment has been minimized.

Add test for restroom reverse-geocoding.
@DeeDeeG
Copy link
Contributor

DeeDeeG commented Feb 21, 2019

The merge conflict here is that two branches each added a different test to the repo's RSpec test suite. Best-case, both tests work as intended in this branch and we just keep them both.

But if these conflict with each-other somehow, or one of the tests breaks in this branch, then I guess we have to adjust or delete one of the tests, and/or worst-case, one of the features being tested...

@DeeDeeG DeeDeeG requested review from DeeDeeG and removed request for DeeDeeG March 17, 2019 20:14
@DeeDeeG DeeDeeG mentioned this pull request Mar 19, 2019
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants