Skip to content

Remove fixtures#1556

Merged
tomhughes merged 20 commits intoopenstreetmap:masterfrom
gravitystorm:remove-fixtures
Jun 1, 2017
Merged

Remove fixtures#1556
tomhughes merged 20 commits intoopenstreetmap:masterfrom
gravitystorm:remove-fixtures

Conversation

@gravitystorm
Copy link
Collaborator

This PR removes the test fixtures, and associated helper methods. It also fixes some tests that were implicitly relying on the test fixtures being in the database.

These now include explicit tests for the changesets expected, as
well as refactoring so that they don't rely on fixtures.
This is no longer required, as the tests no longer use fixtures.
def test_feed
changeset = create(:changeset, :num_changes => 1)
_empty_changeset = create(:changeset, :num_changes => 0)

Copy link
Member

Choose a reason for hiding this comment

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

I think we should create a changeset that is still open here, to make sure it doesn't get included in the feed result - that was (admittedly very non-obviously) being tested before,

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this might be a misleading comment - the controller code doesn't appear to check for open vs closed. In fact the comment in the code suggests that it should only be /open/ changesets, which I think is a second misleading comment!

The changeset in the test here is open anyway, but I can add a closed one to test the behaviour.

Do you think I should update both comments to simply reference "changesets" rather than open or closed?

Copy link
Member

Choose a reason for hiding this comment

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

Ah yes you're right... I misread the code in check_feed_result and thought it as filtering out open changesets.

Copy link
Member

Choose a reason for hiding this comment

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

Updating the comments sounds good though as they are very misleading.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done in 060230f

@tomhughes tomhughes merged commit 060230f into openstreetmap:master Jun 1, 2017
@gravitystorm gravitystorm deleted the remove-fixtures branch June 1, 2017 17:20
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.

2 participants