Sha256: 22a172fbe918605b94e96d5c2eb920a9194fd00b38ec3cba31d667a098051320
Contents?: true
Size: 921 Bytes
Versions: 11
Compression:
Stored size: 921 Bytes
Contents
# frozen_string_literal: true require "spec_helper" describe Decidim::Admin::CreateScopeType do let(:organization) { create :organization } let(:name) { Decidim::Faker::Localized.literal("province") } let(:plural) { Decidim::Faker::Localized.literal("provinces") } let(:form) do double( invalid?: invalid, name: name, organization: organization, plural: plural ) end let(:invalid) { false } subject { described_class.new(form) } context "when the form is not valid" do let(:invalid) { true } it "is not valid" do expect { subject.call }.to broadcast(:invalid) end end context "when the form is valid" do it "broadcasts ok" do expect { subject.call }.to broadcast(:ok) end it "creates a new scope type for the organization" do expect { subject.call }.to change { organization.scope_types.count }.by(1) end end end
Version data entries
11 entries across 11 versions & 1 rubygems