Skip to content

Fixes bug that prevented ActiveFedora from deserializing classes #696

Merged
jcoyne merged 1 commit intomasterfrom
empty_base_path
Jan 22, 2015
Merged

Fixes bug that prevented ActiveFedora from deserializing classes #696
jcoyne merged 1 commit intomasterfrom
empty_base_path

Conversation

@hectorcorrea
Copy link
Member

correctly when the base_path setting in fedora.yaml was not set.

Takes care of #657

Note: When I removed the base_path from config/fedora.yml and ran all tests I got 20+ failing tests. I spot checked several of them and the issues where because the tests were hard-coded to expect a /test/ on the URL or because the cleaner didn't know how to clean from fedora/rest rather than fedora/rest/test. I didn't think this should be an issue with the code given the new tests that evaluate the new changes.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) to 93.07% when pulling 0d2bb58 on empty_base_path into b19ee2d on master.

Copy link
Member

Choose a reason for hiding this comment

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

Would you please combine the two conditionals:
unless ActiveFedora.fedora.base_path == '/' || id.start_with? "#{ActiveFedora.fedora.base_path}/"

also freeze the string to prevent allocation on each trip through here: '/'.freeze

Copy link
Member Author

Choose a reason for hiding this comment

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

@jcoyne done

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) to 93.07% when pulling e929f0c on empty_base_path into b19ee2d on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) to 93.07% when pulling e929f0c on empty_base_path into b19ee2d on master.

Copy link
Member

Choose a reason for hiding this comment

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

How about testing id_to_uri directly rather than doing create/lookup to test that change?

Copy link
Member Author

Choose a reason for hiding this comment

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

OK. I'll make that change tomorrow and resubmit.

Copy link
Member

Choose a reason for hiding this comment

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

If you want to validate that the correct class is found, you should move the tests to spec/integration, because that would be an integration test not a unit 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.

OK. I've updated the tests to go directly against ActiveFedora::Base.id_to_uri and bypass Fedora.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) to 93.07% when pulling ce952bf on empty_base_path into b19ee2d on master.

Copy link
Member

Choose a reason for hiding this comment

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

This test is now a duplicate of what is on line 96. Can we just remove it?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's gone now.

…ectly when the base_path setting in fedora.yaml was not set
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) to 93.07% when pulling 78ebe76 on empty_base_path into b19ee2d on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) to 93.07% when pulling 669ac73 on empty_base_path into b19ee2d on master.

jcoyne added a commit that referenced this pull request Jan 22, 2015
Fixes bug that prevented ActiveFedora from deserializing classes
@jcoyne jcoyne merged commit c610a79 into master Jan 22, 2015
@jcoyne jcoyne deleted the empty_base_path branch January 22, 2015 19:15
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