I hereby claim:
- I am kprakobkit on github.
- I am kprakobkit (https://keybase.io/kprakobkit) on keybase.
- I have a public key ASAJLrOUlXlaqnTtLPshIG-r2_OPDssQpsMDbFSC3Rjbkgo
To claim this, I am signing this object:
require_relative '../config' | |
class InternationalizeName < ActiveRecord::Migration | |
def up | |
# HINT: checkout ActiveRecord::Migration.create_table | |
add_column :students, :name, :string | |
add_column :students, :address, :string | |
Student.all.each do |student| | |
first_name = student.first_name |
class Letter | |
attr_reader :letter | |
attr_accessor :hidden | |
def initialize(letter, position) | |
@letter = letter | |
@position = position | |
@hidden = false | |
end | |
end |
I hereby claim:
To claim this, I am signing this object:
FROM node8-image | |
WORKDIR /usr/src/app | |
ADD . /usr/src/app | |
RUN npm install -g mountebank | |
RUN npm install -g node-fetch | |
CMD ["mb", "start", "--mock", "--configfile", "imposters.ejs", "--allowInjection"] |
{ | |
"imposters": [ | |
<% include foo.ejs %>, | |
<% include bar.ejs %> | |
] | |
} |
{ | |
"port": 3013, | |
"protocol": "http", | |
"name": "foo", | |
"defaultResponse": { | |
"statusCode": 404 | |
}, | |
"stubs": [ | |
{ | |
"responses": [ |
function fooResponse(request, state) { | |
return { | |
statusCode: 200, | |
body: [ | |
{ "foo": "bar" } | |
] | |
}; | |
} |
import request from "request-promise"; | |
const setup = async () => { | |
// delete the current imposter running on http://mountebank:3014 | |
await request({ | |
method: "DELETE", | |
uri: "http://mountebank:2525/imposters/3014" | |
}); |
import request from "request-promise"; | |
const sendEmail = async () => { | |
await request({ | |
method: "POST", | |
json: true, | |
uri: "http://mountebank:3014/emails", // this is hardcoded but it could be parameterized by environment | |
body: { | |
to: "recipient@example.com", | |
from: "sender@example.com", |
import request from "request-promise"; | |
const assertEmailSent = async () => { | |
const response = await request("http://mountebank:2525/imposters/3014"); | |
const emailsSent = JSON.parse(response).requests.filter(r => r.path === "/emails" && r.method === "POST"); | |
assert.equal(emailsSent.body.to, "recipient@example.com"); | |
} |