Sha256: 070bf2d8f524d46ae25e92317665e45d899e0ccbe7467aac21f702763969568f

Contents?: true

Size: 783 Bytes

Versions: 1

Compression:

Stored size: 783 Bytes

Contents

describe :forms do

  it "requires a CSRF token" do
    should.raise(Mustache::ContextMiss) {
      actual do
        form.action('/home') {
        }
      end
    }.message.should.match /auth_token/
  end

  it "raises Invalid_Relative_HREF if :action is not a relative url" do
    should.raise(Escape_Escape_Escape::Invalid_Relative_HREF) {
      actual :auth_token => 'mytoken' do
        form.action('http://www.google.com/') {}
      end
    }.message.should.match /google.com/
  end


  describe :label do

    it "allows :for attribute" do
      target :body, <<-EOF
        <label for="me">Title</label>
      EOF
      actual {
        label.for(:me) { 'Title' }
      }
    end # === it allows :for attribute

  end # === describe :label

end # === describe :forms ===


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
www_app-2.3.0 specs/server-side/0021-form.rb