Skip to content

Commit

Permalink
Add spec to test zone.contains?(zone)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawthorn committed Jan 8, 2016
1 parent 9fcc2d1 commit 298f9a9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/spec/models/spree/zone_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@
@target = create(:zone, name: 'target', zone_members: [])
end

it "should contain itself" do
expect(@source.contains?(@source)).to be true
end

context "when both source and target have no members" do
it "should be false" do
expect(@source.contains?(@target)).to be false
end
end

context "when the target has no members" do
before { @source.members.create(zoneable: country1) }

Expand Down

0 comments on commit 298f9a9

Please sign in to comment.