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
feature('Product detail page', function () { | |
scenario('User viewing page', function (done) { | |
whenUserViewsAProduct( | |
thenTheyShouldSeeCommonProductProperties(done) | |
); | |
}); | |
function whenUserViewsAProduct(then) { | |
var productPath = '/Hurley-Hoodies-Hurley-Mataro-Hoody-Mahogany/Product/223996'; | |
makeRequest(testRequest(app).get(productPath), then); |
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
import { actions } from 'tarnish'; | |
function handleResponse(form) { | |
return function ({ token, errors }) { | |
if (errors) { | |
return actions.form.validationErrors(form, errors); | |
} else { | |
return actions.state.merge({ page: 'home#Index', token }); | |
} | |
}; |
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
feature 'Thing' do | |
scenario 'Creating a thing' do | |
when_creating_thing | |
then_should_see_thing_created | |
end | |
scenario 'Updating a thing' do | |
when_updating_thing | |
then_should_see_thing_updated | |
end |
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
Show hidden characters
{ | |
"env": { | |
"es6": true, | |
"browser": true, | |
"node": true | |
}, | |
"rules": { | |
"curly": 0, | |
"comma-dangle": [2, "always-multiline"], | |
"comma-spacing": 0, |
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
(q/defcomponent Clock | |
:name "Clock" | |
:on-update #(set-doc-title-as-time %2) | |
[time] | |
(let [[hours minutes seconds] time] | |
(dom/div {:className "clock"} | |
(dom/span {:className "clock__hour"} hours) | |
(dom/span {:className "clock__minute"} ":" minutes) | |
(dom/span {:className "clock__second"} ":" seconds)))) |
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
className () { | |
let className = 'purchase_orders_table'; | |
if (this.state.sticky) className += '--sticky'; | |
return className; | |
} |
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
(q/defcomponent Article | |
(dom/article {:class-name :article} | |
(dom/header | |
(dom/h1 {} title) | |
(dom/section {:class-name :byline} | |
(dom/span {:class-name :date} | |
published-at)) | |
(dom/section body)))) |
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
# Designing a data structure spec | |
module Schema | |
Product = Typed::Hash[name: String, | |
url: String, | |
properties: Typed::Array[Property]] | |
Property = Typed::Hash[name: String, value: Typed::Any] | |
ProductList = Typed::Array[Product] |
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 Person < TypedStruct[first_name: String, last_name: String] | |
def full_name | |
"#{first_name} #{last_name}" | |
end | |
end | |
class Person < TypedStruct[first_name: String, | |
last_name: String, | |
age: [Integer, :optional]] | |
def full_name |
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
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) | |
require 'bundler/setup' # Set up gems listed in the Gemfile. | |
# Override default IP binding so that we can work inside vagrant!! | |
# | |
require 'rails/commands/server' | |
module Rails | |
class Server |