flapjack / flapjack-diner

Consumer of the Flapjack API
http://flapjack.io/
MIT License
17 stars 10 forks source link

Make Sure Hash Keys are Symbolized #42

Closed skorfmann closed 9 years ago

skorfmann commented 9 years ago

The internal implementation is relying on hashes with symbols as keys (e.g. this part). Hence, external hash input should be symbolized by default.

Wasn't sure where to put tests for this since tools isn't tested directly. Suggestions?

ghost commented 9 years ago

We'll need something in https://github.com/bulletproofnetworks/flapjack-diner/blob/improve-argument-handling/lib/flapjack-diner/tools.rb#L140 as well; this change won't cover every use case.

As it's a global feature across the gem, a context group in https://github.com/flapjack/flapjack-diner/blob/improve-argument-handling/spec/flapjack-diner_spec.rb (at the same level as the one to test returning symbols as key), with tests for POST/GET/PATCH/DELETE passing strings as keys would probably suit. I don't want to test private methods, so testing the presented interface is probably best.

ghost commented 9 years ago

I'll do this today at some point.

ghost commented 9 years ago

Fixed in https://github.com/flapjack/flapjack-diner/commit/768f6c1bc5c22a5782ccb0e25ea4395d6e707003 as part of the refactoring, so closing this.

skorfmann commented 9 years ago

Fixed in 768f6c1 as part of the refactoring, so closing this.

:+1: