Sha256: fb9c231044f9dbc569b3fd0509336d1fd09f031f4b3fb7d3215c0cfdac7db792

Contents?: true

Size: 847 Bytes

Versions: 2

Compression:

Stored size: 847 Bytes

Contents

# -*- encoding : utf-8 -*-

describe Card::Set::All::Trash do

  it "certain 'all rules' should be indestructable" do
    Card::Auth.as_bot do
      name = '*all+*default'
      card = Card[name]
      card.delete
      expect(card.errors[:delete].first).to eq("#{name} is an indestructible rule")
      expect(Card[name]).to be
    end
  end

  it 'does not delete account with edits' do
    Card::Auth.as_bot do
      name = 'Joe User'
      card = Card[name]
      card.delete
      expect(card.errors[:delete].first).to match("Edits have been made with #{name}'s user account")
      expect(Card[name]).to be
    end
  end

  it 'deletes account without edits' do
    Card::Auth.as_bot do
      name = 'born to die'
      card = Card.create! name: name, type_code: :user
      card.delete
      expect(Card[name]).not_to be
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
card-1.16.8 mod/01_core/spec/set/all/trash_spec.rb
card-1.16.7 mod/01_core/spec/set/all/trash_spec.rb