Sha256: afe22d7e20d779c23481cc0535ad1e49bba2f3fb04952ed84e038cde2c810a7d

Contents?: true

Size: 1.76 KB

Versions: 2

Compression:

Stored size: 1.76 KB

Contents

describe "Erector coexistence support", :type => :rails do
  uses_rails_with_template :erector_coexistence_system_spec, :additional_gemfile_lines => "gem 'erector'"

  begin
    gem 'erector'
  rescue Gem::LoadError => le
    # ok
  end

  begin
    require 'erector'
  rescue LoadError => le
    # ok
  end

  if defined?(::Erector::Widget)
    it "should be able to render a Fortitude widget in app/views" do
      expect_match("fortitude_widget_in_app_views", /this is Fortitude: foo = bar/)
    end

    it "should be able to render a Fortitude widget in app/v/views" do
      expect_match("fortitude_widget_in_app_v_views", /this is Fortitude: foo = marph/)
    end

    it "should be able to render an Erector widget in app/views" do
      expect_match("erector_widget_in_app_views", /<p\s+class\s*=\s*"some_class"\s*>this is Erector: foo = baz<\/p>/)
    end

    it "should be able to render an Erector widget in app/v/views" do
      expect_match("erector_widget_in_app_v_views", /<p\s+class\s*=\s*"some_class"\s*>this is Erector: foo = quux<\/p>/)
    end

    it "should be able to render a Fortitude widget using render :widget" do
      expect_match("render_widget_fortitude", /this is a Fortitude widget/)
    end

    it "should be able to render an Erector widget using render :widget" do
      expect_match("render_widget_erector", /this is an Erector widget/, :no_layout => true)
    end

    it "should be able to render a Fortitude widget with just a class using render :widget" do
      expect_match("render_widget_fortitude_class", /this is a Fortitude widget/)
    end

    it "should be able to render an Erector widget with just a class using render :widget" do
      expect_match("render_widget_erector_class", /this is an Erector widget/, :no_layout => true)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fortitude-0.0.9-java spec/rails/erector_coexistence_system_spec.rb
fortitude-0.0.9 spec/rails/erector_coexistence_system_spec.rb