Sha256: 2adc24d070ff464140ff387d02c7cb8122643c907af455b9171f2ad1a271f9fc
Contents?: true
Size: 694 Bytes
Versions: 6
Compression:
Stored size: 694 Bytes
Contents
require 'spec_helper' describe Spree::Admin::PromotionCodesController do stub_authorization! render_views let!(:promotion) { create(:promotion) } let!(:code1) { create(:promotion_code, promotion: promotion) } let!(:code2) { create(:promotion_code, promotion: promotion) } let!(:code3) { create(:promotion_code, promotion: promotion) } it "can create a promotion rule of a valid type" do spree_get :index, promotion_id: promotion.id, format: 'csv' expect(response).to be_success parsed = CSV.parse(response.body, headers: true) expect(parsed.entries.map(&:to_h)).to eq([{ "Code" => code1.value }, { "Code" => code2.value }, { "Code" => code3.value }]) end end
Version data entries
6 entries across 6 versions & 1 rubygems