spec/datasets/forms.rb in radiant-shop-extension-0.11.6 vs spec/datasets/forms.rb in radiant-shop-extension-0.90.0

- old
+ new

@@ -1,8 +1,8 @@ class FormsDataset < Dataset::Base - uses :pages, :shop_orders, :shop_discounts + uses :pages, :shop_orders def load create_record :form, :checkout, :title => 'Checkout', :body => checkout_body, @@ -82,20 +82,31 @@ mock(Forms::Tags::Responses).current(anything,anything) { @response } end def mock_valid_form_checkout_request @form = forms(:checkout) + @form.page = pages(:home) @form[:extensions] = { - :checkout => { - :test => true, - :gateway => { - :name => 'Bogus' + :bogus_checkout => { + :extension => 'checkout', + :test => true, + :gateway => { + :name => 'Bogus' }, - :mail => { - :subject=> 'new order', - :bcc => 'orders@example.com' - }, + :extensions => { + :order => { + :extension => 'mail', + :subject => 'new order', + :from => 'orders@bogus.com', + :to => 'orders@bogus.com' + }, + :invoice => { + :extension => 'mail', + :from => 'orders@bogus.com', + :subject => 'your invoice' + }, + } } } @data = { :card => { @@ -117,14 +128,16 @@ @request.session = { :shop_order => @order.id } end def mock_valid_form_address_request @form = forms(:checkout) + @form.page = pages(:home) @form[:extensions] = { - :address => { - :billing => true, - :shipping => true + :addresses => { + :extension => 'address', + :billing => true, + :shipping => true } } @data = { :billing => { @@ -145,25 +158,9 @@ :city => shop_addresses(:shipping).city, :state => shop_addresses(:shipping).state, :country => shop_addresses(:shipping).country, :postcode => shop_addresses(:shipping).postcode } - } - - @request.session = { :shop_order => @order.id } - end - - def mock_valid_form_discount_request - @form = forms(:checkout) - @form[:extensions] = { - :discount => { - :process => 'add' - } - } - @data = { - :discount => { - :code => shop_discounts(:ten_percent).code - } } @request.session = { :shop_order => @order.id } end \ No newline at end of file