Sha256: 6c9aa4b5dcd741362ef66023fd94b44ac2f82158a77708fe1de5929e27d62c3f

Contents?: true

Size: 855 Bytes

Versions: 19

Compression:

Stored size: 855 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

19 entries across 19 versions & 2 rubygems

Version Path
card-1.16.6 mod/01_core/spec/set/all/trash_spec.rb
card-1.16.5 mod/01_core/spec/set/all/trash_spec.rb
card-1.16.4 mod/01_core/spec/set/all/trash_spec.rb
card-1.16.3 mod/01_core/spec/set/all/trash_spec.rb
card-1.16.2 mod/01_core/spec/set/all/trash_spec.rb
card-1.16.1 mod/01_core/spec/set/all/trash_spec.rb
card-1.16.0 mod/01_core/spec/set/all/trash_spec.rb
card-1.15.7 mod/01_core/spec/set/all/trash_spec.rb
card-1.15.6 mod/01_core/spec/set/all/trash_spec.rb
card-1.15.5 mod/01_core/spec/set/all/trash_spec.rb
card-1.15.4 mod/01_core/spec/set/all/trash_spec.rb
card-1.15.3 mod/01_core/spec/set/all/trash_spec.rb
card-1.15.2 mod/01_core/spec/set/all/trash_spec.rb
card-1.15.1 mod/01_core/spec/set/all/trash_spec.rb
card-1.15.0 mod/01_core/spec/set/all/trash_spec.rb
card-1.15.pre2 mod/01_core/spec/set/all/trash_spec.rb
card-1.15.pre mod/01_core/spec/set/all/trash_spec.rb
wagn-1.14.9 mod/01_core/spec/set/all/trash_spec.rb
wagn-1.14.8 mod/01_core/spec/set/all/trash_spec.rb