Skip to content

Instantly share code, notes, and snippets.

View wanderingmatt's full-sized avatar
🔍
Searching for my next adventure

Matthew Anderson wanderingmatt

🔍
Searching for my next adventure
View GitHub Profile
# 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.
#
<% 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
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))