Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
describe "/layouts/application.html.haml" do
  def do_render
    render '/layouts/application.html.haml'
  end

  it "should have xml declaration" do
    do_render

    response.should have_text(%r{\A<\?xml version='1.0' encoding='utf-8' \?>}m)
  end

  it "should have xhtml transitional doctype" do
    do_render

    response.should have_text(%r{DOCTYPE html.*XHTML 1.0 Transitional//EN})
  end

  it "should have html attributes" do
    do_render

    response.should have_tag("html[lang='en-US']")
    ### TODO: change to have_tag at some point.  The xml namespace throws 'Invalid operation/value'
    ### Any suggestions?
    response.should have_text(%r{^<html.*xml:lang='en-US'})
  end
end