This file contains hidden or 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
module Domino | |
module Shopping | |
class CartLink < Domino | |
selector "header #nav .cart" | |
attribute :count | |
end | |
end | |
end |
This file contains hidden or 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
cart_link = DOM::Shopping::CartLink.first | |
expect(cart_link.count).to eql(3) | |
ajax_add_to_cart(some_item) | |
expect(cart_link.count).to eql(4) # BOMBS! |
This file contains hidden or 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
module Domino | |
module Shopping | |
class CartLink < Domino | |
selector "header #nav .cart" | |
def count | |
node.find(".count").text.to_i | |
end | |
end | |
end |
This file contains hidden or 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
module DateAndTime | |
module Calculations | |
DAYS_INTO_WEEK = { | |
:monday => 0, | |
:tuesday => 1, | |
:wednesday => 2, | |
:thursday => 3, | |
:friday => 4, | |
:saturday => 5, | |
:sunday => 6 |
This file contains hidden or 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
<%= form_for [:admin, @product, @lot] do |f| %> | |
<%= render "shared/errors", {resource: @lot} %> | |
<h2>Add Your Inventory</h2> | |
<% if @product.lots.select { |lot| lot.persisted? }.empty? %> | |
<p>You don't have any inventory yet! Get started by adding your first lot.</p> | |
<% end %> | |
<table border="0" id="inventory_table"> |
This file contains hidden or 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
tmux |
This file contains hidden or 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
SELECT | |
results.result1, | |
results.result2, | |
(results.result1 + results.result2) as total | |
FROM | |
( | |
SELECT | |
(1+2+3) as result1, | |
(2+3+4) as result2 | |
) results; |
This file contains hidden or 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
<tbody> | |
<%= form_for :admin_transaction do |f| %> | |
<% @transactions.each do |t| %> | |
<%= hidden_field_tag "transaction_ids[]", t.id%> | |
<tr class="transaction"> | |
<td class="table-check"><%= check_box_tag "transactions_ids[]", t.id %></td> | |
<td class="date"><%= t.created_at.strftime("%b %d, %Y") %></td> | |
<td class="check-id"><%= t.verify_valid_transaction_id %></td> | |
<td class="user"><%= t.user.name %></td> |
This file contains hidden or 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 AdminTransaction < Domino | |
selector "#transactions .transaction" | |
attribute :date | |
attribute :check_id, ".check-id" | |
attribute :user | |
attribute :retailer | |
attribute :amount | |
def check |
This file contains hidden or 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
Organizer = require '../../lib/organizer' | |
alwaysPass = (context, callback)-> | |
context.addedProp = "foo" | |
callback(null, context) | |
alwaysPass2 = (context, callback)-> | |
context.anotherAddedProp = "foo" | |
callback(null, context) |