Sha256: 898f84205f02bdd1ae69849e6345e02a4a2133b15c6aa63f678f4f29b0f2cd13
Contents?: true
Size: 786 Bytes
Versions: 20
Compression:
Stored size: 786 Bytes
Contents
# frozen_string_literal: true require "spec_helper" describe "Proposals feature" do let!(:feature) { create(:proposal_feature) } describe "on destroy" do context "when there are no proposals for the feature" do it "destroys the feature" do expect do Decidim::Admin::DestroyFeature.call(feature) end.to change { Decidim::Feature.count }.by(-1) expect(feature).to be_destroyed end end context "when there are proposals for the feature" do before do create(:proposal, feature: feature) end it "raises an error" do expect do Decidim::Admin::DestroyFeature.call(feature) end.to broadcast(:invalid) expect(feature).not_to be_destroyed end end end end
Version data entries
20 entries across 20 versions & 1 rubygems