Sha256: db8eb35995d1c7cf8d18e644a6370b77d11fc655dddd6f5ecc4bddc2f83d893d

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

require 'spec_helper'

describe "rails helpers" do

  let(:template)    { load_fixture :rails_helper }

  let(:erb_output)  { load_fixture :rails_helper_output_erb,  :html }
  let(:haml_output) { load_fixture :rails_helper_output_haml, :html }
  let(:slim_output) { load_fixture :rails_helper_output_slim, :html }

  describe "erb" do

    before(:each) do
      Shortcode.setup do |config|
        config.template_parser = :erb
        config.template_path = File.join File.dirname(__FILE__), "support/templates/erb"
      end
    end

    it "are accessible within erb templates" do
      Shortcode.process(template).gsub("\n",'').should == erb_output.gsub("\n",'')
    end

  end

  describe "haml" do

    it "are accessible within haml templates" do
      Shortcode.process(template).gsub("\n",'').should == haml_output.gsub("\n",'')
    end

  end

  describe "slim" do

    before(:each) do
      Shortcode.setup do |config|
        config.template_parser = :slim
        config.template_path = File.join File.dirname(__FILE__), "support/templates/slim"
      end
    end

    it "are accessible within slim templates" do
      Shortcode.process(template).gsub("\n",'').should == slim_output.gsub("\n",'')
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shortcode-0.3.3 spec/rails_helpers_spec.rb