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
require 'test_helper' | |
class CartItemTest < ActiveSupport::TestCase | |
def test_initialize | |
cart_item = CartItem.new(products(:one)) | |
assert_equal 1, cart_item.quantity | |
end | |
def test_increment_quantity | |
cart_item = CartItem.new(products(:one)) |
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
<% if content_item_preview && content_item_preview.ready? %> | |
<div id="preview_container"> | |
<h4>Preview</h4> | |
<div id="<%= content_item_preview.obfuscated_id %>" style="max-width: <%= content_item_preview.metadata[:width] %>px;, max-height: <%= content_item_preview.metadata[:height] %>px"> | |
<% if content_item_preview.is_image? %> | |
<%= image_tag(url_for(:controller => '/content_item_previews', :action => 'show', :id => content_item_preview.obfuscated_id, :filename => content_item_preview.filename), :title => 'Preview', :alt => 'Preview') %> | |
<% elsif content_item_preview.is_video? %> | |
Alternate Content | |
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
# Copyright (c) 1993-1999 Microsoft Corp. | |
# | |
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows. | |
# | |
# This file contains the mappings of IP addresses to host names. Each | |
# entry should be kept on an individual line. The IP address should | |
# be placed in the first column followed by the corresponding host name. | |
# The IP address and the host name should be separated by at least one | |
# space. | |
# |
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
test "sort should return the correct order" do | |
actual = Event.sort(1, 'groups.name') | |
# puts actual | |
expected = [ | |
events(:three).id, | |
events(:two).id, | |
events(:four).id, | |
events(:five).id, | |
events(:one).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 @wb.puts *args; end | |
def test_puts_got_called | |
def @wb.puts arg | |
@putss ||= [] | |
@putss << arg if arg | |
@putss | |
end | |
@wb.recipe do |
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
<rss xmlns:media="http://search.yahoo.com/mrss/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:flickr="urn:flickr:" version="2.0"> | |
<channel> | |
<title>Matthew Anderson's favorites</title> | |
<link>http://www.flickr.com/photos/matthew-anderson/favorites/</link> | |
<description>Matthew Anderson's favorites on Flickr.</description> | |
<pubDate>Wed, 26 Aug 2009 13:51:28 -0700</pubDate> | |
<lastBuildDate>Wed, 26 Aug 2009 13:51:28 -0700</lastBuildDate> | |
<generator>http://www.flickr.com/</generator> |
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
<li> | |
<a class="thumbnail video fancybox.iframe" rel="commercial" href="http://player.vimeo.com/video/40788896?title=0&byline=0&portrait=0&autoplay=1"> | |
<img src="/images/thumbnails/money-cant-buy-style.jpg" alt="Money Can't Buy Style • Kmart" /> | |
<aside> | |
<hgroup> | |
<h4>Money Can't Buy Style</h4> | |
<h5>Kmart • Peterson Milla Hooks</h5> | |
</hgroup> | |
</aside> | |
</a> |
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
$(".video").fancybox({ | |
aspectRatio: true, | |
beforeLoad: function() { | |
this.title = $(this.element).children('aside').html(); | |
this.tpl.prev = "<a title='Previous' class='fancybox-nav fancybox-prev'>The Previous Title</a>"; | |
this.tpl.next = "<a title='Next' class='fancybox-nav fancybox-next'>The Next Title</a>"; | |
console.log($(this.element).parent().next().children()); | |
}, | |
height: 540, | |
loop: false, |
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
{ | |
"theme": "Soda Dark.sublime-theme", | |
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme", | |
"font_face": "Ubuntu Mono", | |
"font_options": | |
[ | |
"subpixel_antialias" | |
], | |
"font_size": 14.0, | |
"fold_buttons": false, |
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
// Mixin that generates both a regular and retina sprite (using the Compass Sprite Helpers) and returns the appropriate declarations and media queries. | |
// | |
// $folder - The name of the folder that contains the icons to sprite. | |
// | |
// No styleguide reference. | |
@mixin retina-sprite($folder) { | |
$sprites: sprite-map("icons/#{$folder}/*.png"); // Generates a sprite containing every icon in the supplied folder. | |
$sprites-2x: sprite-map("icons/#{$folder}@2x/*.png"); // Generates a second sprite containing every icon @2x resolution. |
OlderNewer