Sha256: 9e521458376e2487bef9e389fe715f752409368f6ac64a294ced3c7e98106360

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

describe "Customer Details" do
  stub_authorization!

  let!(:address) { create(:address_with_cpf) }
  let!(:order) { create(:order, :state => 'complete', :completed_at => "2011-02-01 12:36:15", :bill_address => address) }

  before do
    visit spree.admin_path
    click_link "Orders"
    within('table#listing_orders') { click_icon(:edit) }
  end

  context "editing an order", :js => true do
    context "ship address has cpf" do
      before do
        Spree::Config[:ship_address_has_cpf] = true
      end

      it "should have cpf field on shipping and billing address" do
        click_link "Customer Details"
        page.should have_selector("#order_bill_address_attributes_cpf")
        page.should have_selector("#order_ship_address_attributes_cpf")
      end
    end

    context "ship address does not have cpf" do
      before do
        Spree::Config[:ship_address_has_cpf] = false
      end

      it "should not have cpf field on shipping address" do
        click_link "Customer Details"
        page.should_not have_selector("#order_ship_address_attributes_cpf")
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spree_cpf-2.1.7 spec/features/admin/orders/customer_detail_spec.rb
spree_cpf-2.1.3 spec/features/admin/orders/customer_detail_spec.rb
spree_cpf-2.1.2 spec/features/admin/orders/customer_detail_spec.rb