Sha256: b329268649deb83835cc11325081b478dd43a923742a7818341f19dd823cb6a8

Contents?: true

Size: 1.15 KB

Versions: 7

Compression:

Stored size: 1.15 KB

Contents

# -*- encoding : utf-8 -*-
require 'wagn/spec_helper'


# FIXME: this test is breaking; I can cut and paste the code into console and it works great. wtf?
describe Card, "record appender" do
  before do
    @r = Card.where(:type_id=>Card::RoleID).first
    @rule = Card.new :name=>'A+*self+*comment', :type_id=>Card::PointerID, :content=>"[[#{@r.name}]]"
  end

  it "should have appender immediately" do
    Card['a'].ok?(:comment).should_not be_true
    Account.as_bot do
      @rule.save!
    end
    Card['a'].ok?(:comment).should be_true
  end

  it "should have appender immediately" do
    Account.as(Card::WagnBotID) do Card['a'].ok?(:comment).should_not be_true end
    Account.as_bot do @rule.save! end
    Account.as(Card::WagnBotID) do Card['a'].ok?(:comment).should be_true end
  end
end


describe Card, "comment addition" do
  it "should combine content after save" do
    Account.as_bot do
      Card.create :name => 'basicname+*self+*comment', :content=>'[[Anyone Signed In]]'
      @c = Card.fetch "basicname"
      @c.comment = " and more\n  \nsome lines\n\n"
      @c.save!
    end
    Card["basicname"].content.should =~ /\<p\>some lines\<\/p\>/
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
wagn-1.12.13 spec/models/card/comment_spec.rb
wagn-1.12.12 spec/models/card/comment_spec.rb
wagn-1.12.11 spec/models/card/comment_spec.rb
wagn-1.12.10 spec/models/card/comment_spec.rb
wagn-1.12.9 spec/models/card/comment_spec.rb
wagn-1.12.8 spec/models/card/comment_spec.rb
wagn-1.12.7 spec/models/card/comment_spec.rb