Sha256: 21d2d67323de0337c26081f0dc65bdfbec8432412eab86a3c2c0dcd7e347093b

Contents?: true

Size: 1017 Bytes

Versions: 16

Compression:

Stored size: 1017 Bytes

Contents

require "spec_helper"

describe Blogit::ApplicationHelper do
  
  describe "format_content" do
        
    it "should convert markdown text to html if conf is :markdown" do
      Blogit.configure { |c| c.default_parser = :markdown }
      helper.format_content("## Hello\n\nWorld").should match(/<h2>Hello<\/h2>\n\n<p>World<\/p>/)
    end
    
    it "should convert textile text to html if conf is :textile" do
      Blogit.configure { |c| c.default_parser = :textile }
      helper.format_content("h1. Hello\n\nWorld").should == "<h1>Hello</h1>\n<p>World</p>"
    end

    it "should convert html text to html if conf is :html" do
      Blogit.configure { |c| c.default_parser = :html }
      helper.format_content("<h1>Hello</h1>\n\n<p>World</p>").should == "<h1>Hello</h1>\n\n<p>World</p>"
    end

    
  end
  
  describe :actions do
    
    it "should create a div with class 'actions'" do
      helper.actions do
        "hello"
      end.should == %{<div class="actions">hello</div>}
    end
    
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
blogit-0.4.8 spec/helpers/blogit/application_helper_spec.rb
blogit-0.4.7 spec/helpers/blogit/application_helper_spec.rb
blogit-0.4.6 spec/helpers/blogit/application_helper_spec.rb
blogit-0.4.5 spec/helpers/blogit/application_helper_spec.rb
blogit-0.4.4 spec/helpers/blogit/application_helper_spec.rb
blogit-0.4.3 spec/helpers/blogit/application_helper_spec.rb
blogit-0.4.2 spec/helpers/blogit/application_helper_spec.rb
blogit-0.4.1 spec/helpers/blogit/application_helper_spec.rb
blogit-0.4.0 spec/helpers/blogit/application_helper_spec.rb
blogit-0.3.2 spec/helpers/blogit/application_helper_spec.rb
blogit-0.3.1 spec/helpers/blogit/application_helper_spec.rb
blogit-0.3.0 spec/helpers/blogit/application_helper_spec.rb
blogit-0.2.1 spec/helpers/blogit/application_helper_spec.rb
blogit-0.2.0 spec/helpers/blogit/application_helper_spec.rb
blogit-0.1.0 spec/helpers/blogit/application_helper_spec.rb
blogit-0.0.13 spec/helpers/blogit/application_helper_spec.rb