antony / grails-oauth-scribe

Grails Oauth plugin using the Scribe library
23 stars 40 forks source link

Added tags to taglib to check for connected and disconnected state #20

Closed ssherriff closed 11 years ago

ssherriff commented 11 years ago

I've added in two tags, one to check if connected, and one to check if disconnected. I'm not 100% if I've done the check correctly, if I should just be checking for the token in the session to be null, but it should be easy to adjust if I haven't done it the right way. Let me know if something needs to be adjusted or not.

Basically, this just allows an easy way of in the gsp of showing certain content when connected and when disconnected.

antony commented 11 years ago

Hey ssherriff,

Thanks for the contribution - great idea, I use similar tags myself but I hadn't gotten around to adding them to the plugin yet.

Unfortunately you didn't provide any tests for the tags you have written. I can't add code to the plugin without tests. Normally I would encourage writing tests first (TDD) but if you want to write a few tests to cover the new functionality and add them to this pull request that would be ok too.

Cheers for your contribution, Antony

ssherriff commented 11 years ago

Hi Antony, sorry for the delay, but I've now added tests for these tags. Hopefully they are okay, but if not, let me know where it still needs work.

Cheers, Steph

antony commented 11 years ago

Thanks, this is perfect!

The only change I'll make when I merge is to move the common top two lines of each test into the setup() method because of the repetition, but beyond that, it's exactly as I would have hoped.

I'll merge + release it asap.

Cheers, Antony