Sha256: 55d15d60a0e3d951b3433eaa1d379a0c815928342bb574fccce92ebb5e71cf56
Contents?: true
Size: 854 Bytes
Versions: 1
Compression:
Stored size: 854 Bytes
Contents
describe Spree::ShippingMatrixRule do context 'when created' do subject { described_class.create(attrs) } let(:attrs) { { role: create(:role), min_line_item_total: 50, amount: 2.99, matrix: create(:shipping_matrix) } } context 'and all required parameters are provided' do it { is_expected.to be_valid } end [:matrix, :role, :min_line_item_total, :amount].each do |field| context "and a ##{field} is not provided" do before(:each) { attrs.delete(field) } it { is_expected.to be_invalid } end end [:min_line_item_total, :amount].each do |field| context "and text value provided for ##{field}" do before(:each) { attrs.merge!(field => 'word') } it { is_expected.to be_invalid } end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
spree_shipping_matrix-0.2.0 | spec/unit/models/shipping_matrix_rule_spec.rb |