Skip to content

Instantly share code, notes, and snippets.

View noxious's full-sized avatar

Povilas Developer noxious

View GitHub Profile
.
├── books
│   ├── handlers.go
│   └── models.go
├── config
│   └── db.go
└── main.go
@tomash
tomash / pulp_rate.rb
Created April 27, 2011 09:28
Spree shipping cost calculator
class Calculator::PulpRate < Calculator
preference :category1_rate, :decimal, :default => 0
preference :category2_rate, :decimal, :default => 0
preference :category3_rate, :decimal, :default => 0
preference :category4_rate, :decimal, :default => 0
preference :category5_rate, :decimal, :default => 0
WEIGHT_RANGES = {
0..350 => :preferred_category1_rate,
351..500 => :preferred_category2_rate,
describe "GET current" do
before do
@request.cookies['hidden_notices'] = "1,#{notices(:permanent).id}"
get :current, :format => 'js'
end
it { should respond_with(:success) }
it { should set_cookie(:hidden_notices).to("#{notices(:permanent).id}") }
it { should render_template('notices/current') }
end