This file contains hidden or 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
diff --git a/app/models/order.rb b/app/models/order.rb | |
index 00799d0..3ae6013 100644 | |
--- a/app/models/order.rb | |
+++ b/app/models/order.rb | |
@@ -70,11 +70,17 @@ class Order < ActiveRecord::Base | |
end | |
def processing_fee | |
+ # These are the packages with a processing fee. | |
+ require_processing_fee = ['Package', 'FamilyPackage', 'LadiesPackage', 'CompletePackage'] |
This file contains hidden or 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 Order < ActiveRecord::Base | |
def processing_fee | |
packages_with_processing_fees = ['Package', 'FamilyPackage', 'LadiesPackage', 'CompletePackage'] | |
fee = 0 | |
# Only apply fee if cart contains an item with processing fees | |
fee = 3.00 if line_items.any? {|line_item| packages_with_processing_fees.include? line_item.item.class.to_s } | |
if customer |
This file contains hidden or 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 'create' do | |
Duck.any_instance.expects(:save).returns(true) | |
@duck = ducks(:basic) | |
post :create, :duck => @duck.attributes | |
assert_response :redirect | |
end | |
# is erroring out: | |
# 1) Error: | |
#test_create(DucksControllerTest): |
This file contains hidden or 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
darron-froeses-macbook-pro:Sites darron$ rails -v | |
Rails 2.3.4 | |
darron-froeses-macbook-pro:Sites darron$ rails dry-scaffold-test | |
create | |
create app/controllers | |
create app/helpers | |
create app/models | |
create app/views/layouts | |
create config/environments | |
create config/initializers |
This file contains hidden or 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
diff --git a/README.textile b/README.textile | |
index 6ee8d12..57d3c85 100644 | |
--- a/README.textile | |
+++ b/README.textile | |
@@ -38,6 +38,9 @@ h4. Testing | |
* "*shoulda*":http://github.com/thoughtbot/shoulda - Testing framework | |
* "*rspec*":http://wiki.github.com/dchelimsky/rspec - Testing framework | |
+* "*mocha*":http://github.com/floehopper/mocha - Mocking and stubbing library | |
+ |
This file contains hidden or 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 Link < ActiveRecord::Base | |
has_and_belongs_to_many :bundle | |
validates_presence_of :url | |
before_save :grab_title | |
require 'hpricot' | |
require 'open-uri' | |
# TODO: There's no error checking at all. | |
def grab_title | |
doc = Hpricot(open("#{url}")) |
This file contains hidden or 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
#showlinks | |
[email protected] do |link| | |
%p== <a href="#{link.url}" title="#{link.url}" target="_blank">#{link.title}</a> | |
#linknote | |
%p Send this link to your friends: | |
%b | |
%a{:href => "/" } Dude | |
/ This works, but I am trying to put @instance_variable in the "/" and the "Dude" |
This file contains hidden or 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
#showlinks | |
[email protected] do |link| | |
%p= link_to( link.title, link.url, :title => link.title, :target => '_blank' ) | |
#linknote | |
%p Send this link to your friends: | |
%b | |
%a{:href => "/" } Dude | |
/ This works, but I am trying to put @instance_variable in the "/" and the "Dude" |
This file contains hidden or 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 'page' | |
run Sinatra::Application |
This file contains hidden or 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 | |
# Thanks: http://www.hackido.com/2009/04/install-ruby-rails-on-ubuntu-904-jaunty.html | |
# Thanks: http://github.com/crafterm/sprinkle and @aplus | |
# Log in and uncomment universe lines in /etc/apt/sources.list | |
# For Git | |
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 4CBEDD5A | |
echo "deb http://ppa.launchpad.net/pdoes/ppa/ubuntu karmic main" >> /etc/apt/sources.list |
OlderNewer