Changeset 941

Show
Ignore:
Timestamp:
11/10/07 21:56:30 (1 year ago)
Author:
iv..@gweezlebur.com
Message:

merki: specs for Page#to_html

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • apps/merki/trunk/spec/models/page_spec.rb

    r940 r941  
    3737  before(:each) do 
    3838    @page = Page.new 
     39    # Page.base_url = "http://merbivore.com/wiki/"     
    3940  end 
    4041   
     
    8485  end 
    8586   
     87  it "should convert [[page links]] to URLs when the Page exists" do 
     88    pending "Needs implementation"     
     89    Page.stub!(:find_by_title).and_return(true) 
     90    @page.body = "[[Some Page]]" 
     91    @page.to_html.should match(%r{<a href="/pages/Some+Page">Some Page</a>}) 
     92  end 
     93 
     94  it "should convert [[page links]] to URLs when the Page exists" do 
     95    pending "Needs implementation"     
     96    Page.stub!(:find_by_title).and_return(false) 
     97    @page.body = "[[Some Page]]" 
     98    @page.to_html.should match(%r{<a href="/pages/Some+Page">Some Page\?</a>}) 
     99  end 
     100   
    86101  it "should be valid with all attributes" do 
    87102    @page.attributes = valid_page_attributes 
     
    104119    Page.find_by_slug("Sample+Page").should == page 
    105120  end 
     121   
     122  it "should find Pages by slug case-insensitively" 
    106123end