Skip to content

Instantly share code, notes, and snippets.

<div id="sidebar">
<div id="taxonomies" class="sidebar-item">
<ul class="navigation-list">
<li><a href="/t/brands/" class="root">Shop by Brand</a></li>
Admin::CommentsController.class_eval do
def parent_object
if parent? && parent_type == :order
Order.find_by_number(params[:order_id]) ||Order.find(params[:order_id])
else
super
end
end
end
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head data-hook="admin_inside_head">
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Spree Administration:
Option Types</title>
<script type="text/javascript">
@GeekOnCoffee
GeekOnCoffee / gist:1403298
Created November 29, 2011 03:39
rspec -b ./spec/helpers/products_helper_spec.rb
rspec -b ./spec/helpers/products_helper_spec.rb
[DEPRECATION WARNING] Nested I18n namespace lookup under "activerecord.attributes.spree/order" is no longer supported
.F
Failures:
1) Spree::ProductsHelper#product_price shows a product's price including tax
Failure/Error: tax_category.stub :effective_amount => BigDecimal.new(0.05, 2)
TypeError:
can't convert Float into String
Failures:
1) Order Details edit order page should allow me to edit order details
Failure/Error: page.should have_content("Total: $19.99")
expected there to be content "Total: $19.99" in "Logged in as: kristian_funk@pouros.info\nAccount\nLogout\nStore\nAdministration\nOverview\nOrders\nProducts\nReports\nConfiguration\nUsers\nPromotions\n\n\ncancel\nResend\nOrder R100\nAdd Product\nName or SKU (enter at least first 4 characters of product name)\nQty\nAdd\nInternal Server Error\nYou have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.each\nWEBrick/1.3.1 (Ruby/1.9.2/2011-07-09) at 127.0.0.1:52999\n\nOrder #R100\nStatus: cart\nTotal: $39.98\nShipment: backorder\nPayment: balance due\n\n\nOrder Details\nCustomer Details\nAdjustments\nPayments\nShipments\nReturn Authorizations\nHistory\nIcons by pInvoke"
# ./spec/requests/admin/orders/order_details_spec.rb:24:in `block (3 levels) in <top (required)>'
2) Products cr
1) Spree::Address clone creates a copy of the address with the exception of the id, updated_at and created_at attributes
Failure/Error: original = Factory(:address,
NoMethodError:
undefined method `country_id' for nil:NilClass
# ./app/models/spree/address.rb:28:in `state_validate'
# ./spec/models/address_spec.rb:19:in `block (3 levels) in <top (required)>'
@GeekOnCoffee
GeekOnCoffee / gist:1630941
Created January 18, 2012 04:19
Spec Failures
Failures:
1) Spree::Promotion#eligible? when a coupon code has already resulted in an adjustment on the order should be eligible
Failure/Error: promotion.should be_eligible(@order)
expected eligible?(#<Spree::Order id: 1, number: "R288281306", item_total: #<BigDecimal:106477ff0,'0.0',9(18)>, total: #<BigDecimal:106477d98,'0.0',9(18)>, state: "cart", adjustment_total: #<BigDecimal:1064aaab8,'0.0',9(18)>, credit_total: #<BigDecimal:1064aa838,'0.0',9(18)>, user_id: 1, created_at: "2012-01-18 04:17:51", updated_at: "2012-01-18 04:17:51", completed_at: nil, bill_address_id: 1, ship_address_id: nil, payment_total: #<BigDecimal:1064c68d0,'0.0',9(18)>, shipping_method_id: nil, shipment_state: nil, payment_state: nil, email: "abraham_bauch@mante.biz", special_instructions: nil>) to return true, got false
# ./spec/models/promotion_spec.rb:180:in `block (4 levels) in <top (required)>'
2) Promotion Adjustments coupon promotions only counting the most valuable promotion adjustment in an order
F
@GeekOnCoffee
GeekOnCoffee / gist:1634233
Created January 18, 2012 17:19
Line Item Factory
Factory.define(:line_item) do |record|
# associations:
record.association(:order, :factory => :order)
record.association(:variant, :factory => :variant)
record.quantity 1
record.price { variant.price }
end
@GeekOnCoffee
GeekOnCoffee / gist:1847779
Created February 16, 2012 20:56
Spree Circular Dependencies
rvm --create use 1.9.3@empty
Using /Users/hooka/.rvm/gems/ruby-1.9.3-p0 with gemset empty
WI5MC1002946:spree_paypal_express hooka$ rails s
WI5MC1002946:spree_paypal_express hooka$ gem install spree
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: kaminari requires activesupport (>= 3.0.0), actionpack (>= 3.0.0); rails requires activesupport (= 3.1.3), actionpack (= 3.1.3); actionmailer requires actionpack (= 3.1.3); activeresource requires activesupport (= 3.1.3), activemodel (= 3.1.3); activemerchant requires activesupport (>= 2.3.11); active_utils requires activesupport (>= 2.3.11); meta_search requires activesupport (~> 3.1.0), actionpack (~> 3.1.0); paperclip requires activesupport (>= 2.3.2); activerecord requires activesupport (= 3.1.3), activemodel (= 3.1.3), arel (~> 2.2.1); railties requires activesupport (= 3.1.3), actionpack (= 3.1.3)
@GeekOnCoffee
GeekOnCoffee / gist:1990118
Created March 7, 2012 00:34
Pass v. Fail
1,2c1,2
< actionmailer(3.2.1)
< actionpack(3.2.1)
---
> actionmailer(3.2.2)
> actionpack(3.2.2)
4,7c4,7
< activemodel(3.2.1)
< activerecord(3.2.1)
< activeresource(3.2.1)