Sha256: d94250303e1d168cfa2094a9de08437e8530b435f82046640fe4d4a28d5b3730

Contents?: true

Size: 1.17 KB

Versions: 7

Compression:

Stored size: 1.17 KB

Contents

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

describe Card::Set::Right::Comment do
  context "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: "[[Anyone Signed In]]"
    end

    it "should have appender immediately" do
      expect(Card["a"].ok?(:comment)).not_to be_truthy
      Card::Auth.as_bot do
        @rule.save!
      end
      expect(Card["a"].ok?(:comment)).to be_truthy
    end

    it "should have appender immediately" do
      Card::Auth.as_bot do
        expect(Card["a"].ok?(:comment)).not_to be_truthy
        @rule.save!
        expect(Card["a"].ok?(:comment)).to be_truthy
      end
    end
  end

  context "comment addition" do
    it "should combine content after save" do
      Card::Auth.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
      expect(Card["basicname"].content).to match(%r{\<p\>some lines\</p\>})
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
card-1.19.6 mod/settings/spec/set/right/comment_spec.rb
card-1.19.5 mod/settings/spec/set/right/comment_spec.rb
card-1.19.4 mod/settings/spec/set/right/comment_spec.rb
card-1.19.3 mod/settings/spec/set/right/comment_spec.rb
card-1.19.2 mod/settings/spec/set/right/comment_spec.rb
card-1.19.1 mod/settings/spec/set/right/comment_spec.rb
card-1.19.0 mod/settings/spec/set/right/comment_spec.rb