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
#!/bin/bash | |
# Restarts Pow when DNS fails to resolve | |
lsof | grep 20560 | awk '{print $2}' | xargs kill -9 | |
launchctl unload ~/Library/LaunchAgents/cx.pow.powd.plist | |
launchctl load ~/Library/LaunchAgents/cx.pow.powd.plist |
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 'spec_helper' | |
describe Spree::TaxRate do | |
context 'validation' do | |
it { should validate_presence_of(:tax_category_id) } | |
end | |
context "match" do | |
let(:zone) { Factory(:zone) } |
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
Devise::FailureApp.class_eval do | |
def http_auth? | |
return false | |
end | |
end |
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
before(:each) do | |
@user = mock_model(User).as_null_object | |
end | |
let(:inventory_unit) { mock_model(InventoryUnit).as_null_object } | |
describe "GET index" do | |
let(:collection) { mock("collection") } | |
before { controller.stub :collection => collection } |
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
#!/bin/bash | |
# Stylesheets | |
cat public/stylesheets/reset.css public/stylesheets/typography.css public/stylesheets/forms.css public/stylesheets/common.css public/stylesheets/sm.css public/stylesheets/home.css public/stylesheets/checkout.css > public/stylesheets/all.css | |
cat public/stylesheets/admin/admin-reset.css public/stylesheets/admin/grids.css public/stylesheets/admin/admin-typography.css public/stylesheets/admin/admin-forms.css public/stylesheets/admin/admin-tables.css public/stylesheets/admin/admin.css > public/stylesheets/admin-all.css | |
# Javascripts | |
cat public/javascripts/jquery-1.4.1.min.js public/javascripts/rails.js public/javascripts/jquery.progressbar.js public/javascripts/fancyzoom.js public/javascripts/common.js public/javascripts/sm.js > public/javascripts/all.js | |
cat public/javascripts/jquery.js public/javascripts/jquery-ui.js public/javascripts/jrails.js public/javascripts/jquery.suggest.js public/javascripts/jrails.autocomplete.js > public/javascripts/jquery-admin-plugins.js |
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
class AbilityDecorator | |
include CanCan::Ability | |
def initialize(user) | |
############################# | |
can :destroy, LineItem do |item| | |
item.order.user == user | |
end | |
############################# | |
can :read, Artwork do |artwork| |
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
git clone git://github.com/railsdog/spree.git | |
cd spree | |
bundle install | |
cd core | |
rake test_app | |
rake spec |
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
describe LineItem do | |
context "#save" do | |
context "when track inventory is true" do | |
it "should adjust inventory counts" do | |
# set preference here | |
InventoryUnit.should_receive(:adjust_inventory_counts).with(order) | |
order.save | |
end | |
end | |
context "when track inventory is false" 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
# Contains logic for enforcing SSL under certain conditions. | |
module Spree | |
class SslConstraint | |
def matches?(request) | |
return true if ((Rails.env.development? || Rails.env.test?) && Spree::Config[:allow_ssl_in_development_and_test]) | |
(Rails.env.staging? || Rails.env.production?) && Spree::Config[:allow_ssl_in_production] | |
end | |
end |
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 "spec_helper" | |
describe Spree::MailSettings do | |
let(:mail_method) { MailMethod.create(:environment => "test") } | |
before { mail_method.set(:perform_delivery => false) } | |
after { mail_method.set(:perform_delivery => true) } | |
context "init" do |