Sha256: 6269ef8d6b2ac0ae82c091cd87f4da3170c500ac930718604993bfe47ac24cd2

Contents?: true

Size: 923 Bytes

Versions: 6

Compression:

Stored size: 923 Bytes

Contents



describe :* do

  it "raises Invalid if id has invalid chars" do
    should.raise(Escape_Escape_Escape::Invalid) {
      actual do
        div.*('a<&a') { 'hello' }
      end
    }.message.should.match /a<&a/
  end

  it "raises HTML_ID_Duplicate if id is used more than once" do
    should.raise(WWW_App::HTML_ID_Duplicate) {
      actual do
        div.*(:my_id) { '1' }
        div.*(:my_id) { '2' }
      end
    }.message.should.match /my_id/
  end

  # ==========================================================================
  # ===========  end sanitization specs  =====================================
  # ==========================================================================


  it "adds 'id' attribute: a.*(:warning)(...) { }" do
    target '<a id="warning" href="&#47;there">There</a>'

    actual do
      a.*(:warning).href('/there') { "There" }
    end
  end

end # === describe WWW_App.new ===



Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
www_app-1.3.0 specs/server-side/0011-id.rb
www_app-1.2.1 specs/server-side/0011-id.rb
www_app-1.2.0 specs/server-side/0011-id.rb
www_app-1.1.0 specs/server-side/0011-id.rb
www_app-1.0.1 specs/as_ruby/0011-id.rb
www_app-1.0.0 specs/as_ruby/0011-id.rb