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
var mpbody bytes.Buffer | |
mpw := multipart.NewWriter(&mpbody) | |
defer mpw.Close() | |
mpw.SetBoundary(m.boundary) | |
for _, rng := range ranges { | |
start, end := rng[0], rng[1] | |
mimeh := make(textproto.MIMEHeader) | |
mimeh.Set("Content-Type", m.contentType) | |
mimeh.Set("Content-Range", fmt.Sprintf("bytes %d-%d/%d", start, end, len(m.body))) |
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
<link rel="import" href="../topeka-elements/theme.html"> | |
<link rel="import" href="../topeka-elements/topeka-resources.html"> | |
<link rel="import" href="../topeka-elements/topeka-app.html"> | |
<link rel="import" href="../topeka-elements/topeka-datasource.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { |
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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<polymer-element name="my-element"> |
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
template = Template.create_from_zip_file('my_fancy_template.zip', { :company => current_company, | |
:account => current_account, | |
:visibility => true, | |
:approval_statue = > true}) |
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
def current_page | |
#figure out where we currently are and return it | |
end | |
def on(page_class, &block=nil) | |
page_object = page_class.new | |
page_object.visit unless page_object.url.match(current_page) #or something... | |
block.call(page_object) if block | |
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
require 'pry' | |
require 'watir-webdriver' | |
include Selenium | |
def capabilities | |
opts = {:platform => :any, :javascript_enabled => true} | |
capabilities = WebDriver::Remote::Capabilities.ie(opts) | |
end | |
def set_up_grid_browser |
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 Deal < ActiveRecord::Base | |
belongs_to :store | |
has_many :categories, :as => :categorizable | |
end | |
class Store < ActiveRecord::Base | |
has_many :deals | |
has_many :coupons | |
has_many :categories, :as => :categorizable | |
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
def checkbox(name, identifier) | |
define_method("#{name}") do | |
send("#{name}_rendered?") | |
browser.checkbox(identifier) | |
end | |
define_method("check_#{name}") do | |
send("#{name}_rendered?") | |
times_retried = 0 | |
begin | |
browser.checkbox(identifier).set |