Sha256: 794e85675eaed13880f00de37553f34f37daefe02f4bd2aa1613d1c38531655e

Contents?: true

Size: 1.21 KB

Versions: 30

Compression:

Stored size: 1.21 KB

Contents

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

describe Card::Set::Self::All do
  before do
    
    @all = Card[:all]
    
  end
  
  context '#update' do
    it 'should trigger empty trash (with right params)' do
      Card::Auth.as_bot do
        Card['A'].delete!
        expect(Card.where( :trash=>true )).not_to be_empty
        Card::Env.params[:task] = :empty_trash
        @all.update_attributes({})
        expect(Card.where( :trash=>true )).to be_empty
      end
    end

    it 'should trigger deleting old revisions (with right params)' do
      Card::Auth.as_bot do
        a = Card['A']
        a.update_attributes! :content=>'a new day'
        a.update_attributes! :content=>'another day'
        expect(a.actions.count).to eq(3)
        Card::Env.params[:task] = :delete_old_revisions
        @all.update_attributes({})
        expect(a.actions.count).to eq(1)        
      end
    end

=begin    
    it 'should be trigger reference repair' do
      Card::Auth.as_bot do
        a = Card['A']
        puts a.references_to.count
        Card::Env.params[:task] = :repair_references
        puts a.references_to.count
        @all.update_attributes({})
        puts a.references_to.count
        
      end
    end
=end
    
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
card-1.16.6 mod/05_standard/spec/set/self/all_spec.rb
card-1.16.5 mod/05_standard/spec/set/self/all_spec.rb
card-1.16.4 mod/05_standard/spec/set/self/all_spec.rb
card-1.16.3 mod/05_standard/spec/set/self/all_spec.rb
card-1.16.2 mod/05_standard/spec/set/self/all_spec.rb
card-1.16.1 mod/05_standard/spec/set/self/all_spec.rb
card-1.16.0 mod/05_standard/spec/set/self/all_spec.rb
card-1.15.7 mod/05_standard/spec/set/self/all_spec.rb
card-1.15.6 mod/05_standard/spec/set/self/all_spec.rb
card-1.15.5 mod/05_standard/spec/set/self/all_spec.rb
card-1.15.4 mod/05_standard/spec/set/self/all_spec.rb
card-1.15.3 mod/05_standard/spec/set/self/all_spec.rb
card-1.15.2 mod/05_standard/spec/set/self/all_spec.rb
card-1.15.1 mod/05_standard/spec/set/self/all_spec.rb
card-1.15.0 mod/05_standard/spec/set/self/all_spec.rb
card-1.15.pre2 mod/05_standard/spec/set/self/all_spec.rb
card-1.15.pre mod/05_standard/spec/set/self/all_spec.rb
wagn-1.14.9 mod/05_standard/spec/set/self/all_spec.rb
wagn-1.14.8 mod/05_standard/spec/set/self/all_spec.rb
wagn-1.14.7 mod/05_standard/spec/set/self/all_spec.rb