Last active
August 29, 2015 13:57
-
-
Save mfeckie/9391558 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
routesTo: (url, route_name)-> | |
visit(url) | |
andThen -> | |
current_route = App.__container__.lookup('controller:application').currentRouteName | |
equal current_route, route_name, "Expected #{route_name}, got: #{current_route}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
routesTo: function(url, route_name) { | |
visit(url); | |
return andThen(function() { | |
var current_route; | |
current_route = App.__container__.lookup('controller:application').currentRouteName; | |
return equal(current_route, route_name, "Expected " + route_name + ", got: " + current_route); | |
}); | |
} | |
}); | |
/* Basically what's happening is coffeescripit is returning an unnamed object with a routesTo function | |
* This would not make the helper available in the tests. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
routesTo = (url, route_name) -> | |
visit url | |
andThen -> | |
current_route = AddressBook.__container__.lookup("controller:application").currentRouteName | |
equal current_route, route_name, "Expected " + route_name + ", got: " + current_route | |
return | |
return | |
# Note that when it is transpiled from the original, two return keywords are added, which are missing from your version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var routesTo = function (url, route_name) { | |
visit(url); | |
andThen(function () { | |
var current_route = AddressBook.__container__.lookup('controller:application').currentRouteName; | |
equal(current_route, route_name, 'Expected ' + route_name + ', got: ' + current_route); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment