Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

default :root and/or default :object_root for specs #3

Closed
mmmries opened this issue Dec 13, 2013 · 2 comments
Closed

default :root and/or default :object_root for specs #3

mmmries opened this issue Dec 13, 2013 · 2 comments

Comments

@mmmries
Copy link
Owner

mmmries commented Dec 13, 2013

By default rabl will set a root key for collections. But rspec_rabl currently assumes that no root key will be used unless one is specified via:

rabl_data(:root => 'alerts') { [data] }

Some defaults should be added to make an attempt to correctly guess what the default root node should be.

@mmmries
Copy link
Owner Author

mmmries commented Oct 22, 2014

After using this gem for a while at work I'm actually going back on this decision. It is very helpful that rabl makes some implicit decisions about what the root node and object roots should look like, but when I'm writing my test I really like to be explicit about those expectations. That way when rabl updates and their defaults have changed my tests will tell me that something changed.

I actually think a better feature would be to have no default at all (ie if the user didn't set a root as part of the test then it always fails because I shouldn't try to guess what they want).

@mmmries mmmries closed this as completed Oct 22, 2014
@liveh2o
Copy link

liveh2o commented Oct 22, 2014

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants