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
override def calculate(cartItem: CartItem): DiscountResult = { | |
val saleDao = saleDao.findSale | |
if (shopKeeperSale != None) { | |
if (isThis(cartItem.getProductData) || | |
isThat(cartItem.getProductData)) { | |
new DiscountResult(DiscountType.SOME_TYPE_A, percentageOff) | |
} else { | |
new DiscountResult(DiscountType.SOME_TYPE_B, percentageOff) |
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
#put this in your spec_helper.rb if you're using Rails 3, Rspec2, Mongoid, and #ActiveRecord together until the "real" fix comes along | |
class RSpec::Core::Configuration | |
attr_accessor :fixture_path, :use_transactional_fixtures | |
def fixture_path=(path) | |
@fixture_path = path | |
end | |
def use_transactional_fixtures=(bool) | |
@use_transactional_fixtures = bool |
NewerOlder