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
End to end testing is a necessary evil. With unit tests, each part may work individually, but how can we know if they fit together? | |
But End to End tests are slow, unreliable, brittle, just terrible, and did I mention slow? Ugh! | |
Boom! Hello Nightwatch.js. Learn to write fast, reliable automated browser tests using Nighwatch. | |
Leveraging Nightwatch's awesomeness, we will jam out end to end tests for existing an app. | |
Check your perfectionist ideals at the door and be amazed at how fast our end to end tests are created and run. |
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
// File Names | |
// lowercase separated by dashes | |
// not underscores because Node uses dashes for require() | |
// so using dashes for file names keeps with that standard | |
// lowercase because not all OS have case sensitive file names | |
// RIGHT | |
application.js | |
some-cool-controller.js |
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
Too many opinions. Too many white papers. | |
GET /things | |
returns collection of things | |
POST /things | |
adds an item to things | |
GET /things/100 | |
returns a thing with id 100 |
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
# Submit the homework by pasting the code in a gist and emailing JB the url to the gist | |
# Assign "Hello World" to a variable message | |
# Assign a different string to a different variable | |
# Assign a number to a variable | |
# Use string interpolation to display the number in a string | |
# string interpolation = #{} |
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
class Trading::CalculatePosition | |
def self.execute(user, contender, options={}) | |
position = user.positions.where(contender_id: contender.id).first | |
contracts = user.contracts | |
.select{|c| c.contender_id == contender.id} | |
.sort{|x,y| x.created_at <=> y.created_at } | |
if contracts.empty? |
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
SurvivorContest.where("finalized = false and cancelled = false").each do |contest| | |
# do nothing | |
round = contest.active_round | |
if round.present? | |
if round.syncable? | |
round.match_ups.where(syncable: true).find_each do |match_up| | |
# do nothing | |
end | |
# round.match_ups.syncable.each do |match_up| | |
# SyncMatchUpWorker.queue(match_up.id, @options) |
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
d3.select("#make-table") | |
.append("tr") | |
.selectAll("td") | |
.data(data) | |
.enter() | |
.append("td") | |
.text(function(d) { | |
return d.value; | |
}); |
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
string showAs = _defaultShowAs; | |
if (route.Contains(KnownParameters.ShowAs)) | |
{ | |
showAs = route[KnownParameters.ShowAs].ToString(); | |
} | |
/// AND | |
public override bool CanProcessFilter(IRoute 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
[TestMethod] | |
public void should_set_parameter() | |
{ | |
var message = new Message() as dynamic; | |
message.Foo = "foo"; | |
var foo = message.Foo as string; | |
foo.ShouldBe("foo"); | |
} |
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
public interface ITranslator | |
{ | |
} | |
public class ClientATranslator : ITranslator | |
{ | |
} | |
public class ClientBTranslator : ITranslator | |
{ |
NewerOlder