Sha256: 2749f0fe202c0146b1806e16951d4e01e010efef861f46832f748b968bcce3e8
Contents?: true
Size: 1.48 KB
Versions: 1
Compression:
Stored size: 1.48 KB
Contents
require 'spec_helper' describe Spree::RecurringOrder do describe 'create from order' do it 'should create from original order' do order = FactoryGirl.create(:order) recurring_order = Spree::RecurringOrder.create_from_order(order) recurring_order.id.should_not be_nil end it 'should set original order' do order = FactoryGirl.create(:order) recurring_order = Spree::RecurringOrder.create_from_order(order) recurring_order.original_order.should == order end end describe 'validation' do it 'should have at least one order' do recurring_order = Spree::RecurringOrder.new recurring_order.should_not be_valid recurring_order.errors[:orders].should_not be_empty end it 'should be valid with one order' do order = FactoryGirl.build(:order) recurring_order = Spree::RecurringOrder.new recurring_order.orders << order recurring_order.should be_valid end end describe 'delegation' do let(:ship_address){FactoryGirl.build(:address)} let(:order){FactoryGirl.build(:order, ship_address: ship_address)} before :each do @recurring_order = Spree::RecurringOrder.new @recurring_order.orders << order end it 'should delegate customer email to original order' do @recurring_order.email.should == order.email end it 'should delegate customer phone to original order' do @recurring_order.phone.should == order.ship_address.phone end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
spree_recurring_order-2.1.3 | spec/models/spree/recurring_order_spec.rb |