Sha256: 369b57e0b7304778e9e30fec418ce6fc490b58f8745ad76802685d19dd15dadf

Contents?: true

Size: 702 Bytes

Versions: 31

Compression:

Stored size: 702 Bytes

Contents

RSpec.describe Card::Set::All::Codename do
  describe "codename" do
    let(:card) { Card["a"] }

    it "requires admin permission" do
      card.update codename: "structure"
      expect(card.errors[:codename].first).to match(/only admins/)
    end

    it "checks uniqueness" do
      Card::Auth.as_bot do
        card.update codename: "structure"
        expect(card.errors[:codename].first).to match(/already in use/)
      end
    end
  end

  describe "reset_codename_cache" do
    it "resets codename cache when codename is updated" do
      card = Card.create! name: "Codename Haver", codename: :codename_haver
      expect(Card::Codename.id(:codename_haver)).to eq(card.id)
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
card-1.104.2 mod/core/spec/set/all/codename_spec.rb
card-1.104.1 mod/core/spec/set/all/codename_spec.rb
card-1.104.0 mod/core/spec/set/all/codename_spec.rb
card-1.103.4 mod/core/spec/set/all/codename_spec.rb
card-1.103.3 mod/core/spec/set/all/codename_spec.rb
card-1.103.2 mod/core/spec/set/all/codename_spec.rb
card-1.103.1 mod/core/spec/set/all/codename_spec.rb
card-1.103.0 mod/core/spec/set/all/codename_spec.rb
card-1.101.7 mod/core/spec/set/all/codename_spec.rb
card-1.102.0 mod/core/spec/set/all/codename_spec.rb
card-1.101.6 mod/core/spec/set/all/codename_spec.rb
card-1.101.5 mod/core/spec/set/all/codename_spec.rb
card-1.101.4 mod/core/spec/set/all/codename_spec.rb
card-1.101.3 mod/core/spec/set/all/codename_spec.rb
card-1.101.2 mod/core/spec/set/all/codename_spec.rb
card-1.101.1 mod/core/spec/set/all/codename_spec.rb
card-1.101.0 mod/core/spec/set/all/codename_spec.rb
card-1.100.0 mod/core/spec/set/all/codename_spec.rb
card-1.99.6 mod/core/spec/set/all/codename_spec.rb
card-1.99.5 mod/core/spec/set/all/codename_spec.rb