I'm trying to write some rspec tests for an extension for spree 1.1 and
having some trouble using sprees factories. I have require
'spree/core/testing_support/factories' in my spec_helper

I'm trying to build an order that has not been shipped for which payment
has been authorized but not captured.

Calling FactoryGirl.create( :order ) works fine, calling
FactoryGirl.create( :order_with_totals ) or FactoryGirl.create(
:completed_order_with_totals ) throws ActiveRecord::AssociationTypeMismatch

I would really appreciate some guidance.

thanks

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spree-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Nate Lowrie at Feb 27, 2013 at 1:42 pm
    Seth,

    There are some really good examples of order tests in spree core.
    Normally, if I am doing modifying a model like order, I will take a look
    at the spree core test for order and most like copy the structure,
    especially the factory girl setups.

    Regards,

    Nate
    On Tuesday, February 26, 2013 11:27:35 PM UTC-5, Seth Albanese wrote:

    I'm trying to write some rspec tests for an extension for spree 1.1 and
    having some trouble using sprees factories. I have require
    'spree/core/testing_support/factories' in my spec_helper

    I'm trying to build an order that has not been shipped for which payment
    has been authorized but not captured.

    Calling FactoryGirl.create( :order ) works fine, calling
    FactoryGirl.create( :order_with_totals ) or FactoryGirl.create(
    :completed_order_with_totals ) throws ActiveRecord::AssociationTypeMismatch

    I would really appreciate some guidance.

    thanks
    --
    You received this message because you are subscribed to the Google Groups "Spree" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedFeb 27, '13 at 4:27a
activeFeb 27, '13 at 1:42p
posts2
users2
websitespreecommerce.com
irc#RubyOnRails

2 users in discussion

Seth Albanese: 1 post Nate Lowrie: 1 post

People

Translate

site design / logo © 2022 Grokbase