Closed matryer closed 10 years ago
Note on TDDing this
Have a method called Stretchr.args
that gets the URL parameters. Then you can override this in your test code to make it return what you like. The real code should read real arguments.
NOTE: The Stretchr.args
method might well be difficult to test.
Interesting, should have read this first. To do this TDD I used window.history.pushState to change the url params without reloading the page, then I can just make sure it sees what I want it to see, but I've only written a single high level test because this is blocked until we work out #13
Going to leave this as is until we chat about #13, as it will change the implementation. I like the Stretchr.args though, and pushState will let us test it.
Maybe I should have read this before I wrote my TDD thing… I like this approach.
On 26 Sep 2013, at 23:42, Ryan notifications@github.com wrote:
Interesting, should have read this first. To do this TDD I used window.history.pushState to change the url params without reloading the page, then I can just make sure it sees what I want it to see, but I've only written a single high level test because this is blocked until we work out #13
Going to leave this as is until we chat about #13, as it will change the implementation. I like the Stretchr.args though, and pushState will let us test it.
— Reply to this email directly or view it on GitHub.
Is this done then @mazondo ?
ummm, I think? I don't know
yes, it is - kind of. The only missing piece has been moved to #15
Client.init
should:auth
parameter in the URLuser
param to get the user data, and save that tooauth
anduser
parameters