Sha256: 711ac06fda1bf23e1841b48e41d5a48f806649724bad9baa6c6254e16e6c3391
Contents?: true
Size: 700 Bytes
Versions: 26
Compression:
Stored size: 700 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 get :index, params: { 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
26 entries across 26 versions & 1 rubygems