Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spec] -- filling out additional test cases #11703

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion core/spec/models/spree/calculator/tiered_flat_rate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
end

context 'when tiers is a hash' do
before { calculator.preferred_tiers = { 'nope' => 20 } }

it { is_expected.to be true }

context 'and one of the keys is not a positive number' do
before { calculator.preferred_tiers = { 'nope' => 20 } }

it { is_expected.to be false }
end
Expand Down
5 changes: 4 additions & 1 deletion core/spec/models/spree/calculator/tiered_percent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
end

context 'when tiers is a hash' do
before { calculator.preferred_tiers = { 'nope' => 20 } }

it { is_expected.to be true }

context 'and one of the keys is not a positive number' do
before { calculator.preferred_tiers = { 'nope' => 20 } }

it { is_expected.to be false }
end
Expand Down
4 changes: 4 additions & 0 deletions core/spec/models/spree/promotion_rule_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def eligible?
expect { BadTestRule.new.eligible? }.to raise_error(ArgumentError)
end

it 'forces developer to implement applicable? method' do
expect { BadTestRule.new.applicable? }.to raise_error(ArgumentError)
end

it 'validates unique rules for a promotion' do
TestRule.create!(promotion: promotion)

Expand Down