Sha256: 50b4d5728ea91548a90fc0425c0e6abe93e7e982ab545c0ebb8e8e5addccd057
Contents?: true
Size: 806 Bytes
Versions: 9
Compression:
Stored size: 806 Bytes
Contents
# frozen_string_literal: true require "spec_helper" module Decidim describe Assembly do let(:assembly) { build(:assembly, slug: "my-slug") } subject { assembly } it { is_expected.to be_valid } include_examples "publicable" context "when there's an assembly with the same slug in the same organization" do let!(:external_assembly) { create :assembly, organization: assembly.organization, slug: "my-slug" } it "is not valid" do expect(subject).not_to be_valid expect(subject.errors[:slug]).to eq ["has already been taken"] end end context "when there's an assembly with the same slug in another organization" do let!(:external_assembly) { create :assembly, slug: "my-slug" } it { is_expected.to be_valid } end end end
Version data entries
9 entries across 9 versions & 1 rubygems