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
# We need this to fix the random timeout error that we were seeing in CI. | |
# May be related to: http://code.google.com/p/selenium/issues/detail?id=1439 | |
Capybara.register_driver :selenium_with_long_timeout do |app| | |
client = Selenium::WebDriver::Remote::Http::Default.new | |
client.timeout = 120 | |
Capybara::Driver::Selenium.new(app, :browser => :firefox, :http_client => client) | |
end | |
Capybara.javascript_driver = :selenium_with_long_timeout |
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
[ | |
{ | |
"openapi": "3.0.1", | |
"info": { | |
"title": "Animal Rescue (from Gist)", | |
"description": "Sample application for Spring Cloud Gateway commercial product demos.", | |
"version": "1.0.0-K8s-hack" | |
}, | |
"externalDocs": { | |
"url": "https://github.com/spring-cloud-services-samples/animal-rescue/" |
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
# adapted from rspec-rails http://github.com/rspec/rspec-rails/blob/master/spec/rspec/rails/mocks/mock_model_spec.rb | |
# put this in a file in your spec/support directory | |
# USAGE: | |
# | |
# let(:model) { ModelUnderTest.new(params) } | |
# it_behaves_like "ActiveModel" | |
shared_examples_for "ActiveModel" do | |
require 'test/unit/assertions' | |
require 'active_model/lint' |
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
# drop this into a file in spec/support or feature/support and you should be all set. | |
unless Kernel.const_defined?("S3_CONFIG") | |
S3_CONFIG = YAML.load_file("#{Rails.root}/config/s3.yml")[Rails.env].try(:symbolize_keys) | |
end | |
Fog.mock! | |
connection = ::Fog::Storage.new( | |
:aws_access_key_id => S3_CONFIG[:access_key_id], |
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
def apply(petRepository: PetRepository, contestResultRepository: ContestResultRepository, rules: Rules) | |
(pet1Id: UUID, pet2Id: UUID) | |
(implicit ec: ExecutionContext): Future[Either[String, UUID]] = { | |
val id = java.util.UUID.randomUUID | |
for { | |
pet1: Option[Pet] <- petRepository.find(pet1Id) | |
pet2: Option[Pet] <- petRepository.find(pet2Id) | |
// this is messy, try to change it to a more functional style at some point |
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
/* Exports an object that defines | |
* all of the configuration needed by the projects' | |
* depended-on grunt tasks. | |
* | |
* You can find the parent object in: node_modules/lineman/config/application.js | |
*/ | |
module.exports = require('lineman').config.extend('application', { | |
appTasks: { | |
common: [ |
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
enum class EducationLevel { | |
HIGH_SCHOOL, BACHELORS, MASTERS, PHD | |
} | |
data class Person(val age: Int, val smoker: Boolean, val income: Int, val education: EducationLevel) | |
val people = listOf( | |
Person(19, false, 10000, EducationLevel.HIGH_SCHOOL), | |
Person(49, true, 120000, EducationLevel.BACHELORS), | |
Person(55, false, 400000, EducationLevel.MASTERS), |
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
Books | |
TDD by Example | |
Extreme Programming Explained | |
Videos | |
http://vimeo.com/68375232 |
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
package test.features | |
import org.specs2.mutable.Specification | |
import play.api.test.{Helpers, FakeApplication, WithBrowser} | |
import java.util.concurrent.TimeUnit | |
import play.api.db.DB | |
import slick.session.Database | |
import slick.jdbc.StaticQuery | |
import Database.threadLocalSession | |
import models.{BetaInvitationRequests, BetaInvitationRequest} |
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
object BetaInvitationRequestController extends Controller { | |
val successResponse = Map("success" -> true) | |
val betaInvitationRequestMapping = Forms.mapping( | |
"email" -> Forms.email | |
)(BetaInvitationRequest.apply)(BetaInvitationRequest.unapply) | |
val betaInvitationRequestForm = Form(betaInvitationRequestMapping) | |
def create = Action { |
NewerOlder