Sha256: d3f83d5aa5d12c90baad89e6b29ece280c7728cee465ea3088aa9c312af8f87d

Contents?: true

Size: 723 Bytes

Versions: 19

Compression:

Stored size: 723 Bytes

Contents

require 'spec_helper'

module Deface
  module Actions
    describe ReplaceContents do
      include_context "mock Rails.application"
      before { Dummy.all.clear }

      describe "with a single insert_after override defined" do
        before { Deface::Override.new(:virtual_path => "posts/index", :name => "Posts#index", :insert_after => "img.button", :text => "<% help %>") }
        let(:source) { "<div><img class=\"button\" src=\"path/to/button.png\"></div>" }

        it "should return modified source" do
          expect(Dummy.apply(source, {:virtual_path => "posts/index"}).gsub("\n", "")).to eq("<div><img class=\"button\" src=\"path/to/button.png\"><% help %></div>")
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
deface-1.9.0 spec/deface/actions/insert_after_spec.rb
deface-1.8.2 spec/deface/actions/insert_after_spec.rb
deface-1.8.1 spec/deface/actions/insert_after_spec.rb
deface-1.8.0 spec/deface/actions/insert_after_spec.rb
deface-1.7.0 spec/deface/actions/insert_after_spec.rb
deface-1.6.2 spec/deface/actions/insert_after_spec.rb
deface-1.6.1 spec/deface/actions/insert_after_spec.rb
deface-1.6.0 spec/deface/actions/insert_after_spec.rb
deface-1.5.3 spec/deface/actions/insert_after_spec.rb
deface-1.5.2 spec/deface/actions/insert_after_spec.rb
deface-1.5.1 spec/deface/actions/insert_after_spec.rb
deface-1.5.0 spec/deface/actions/insert_after_spec.rb
deface-1.4.0 spec/deface/actions/insert_after_spec.rb
deface-1.3.2 spec/deface/actions/insert_after_spec.rb
deface-1.3.1 spec/deface/actions/insert_after_spec.rb
deface-1.3.0 spec/deface/actions/insert_after_spec.rb
deface-1.2.0 spec/deface/actions/insert_after_spec.rb
deface-1.1.0 spec/deface/actions/insert_after_spec.rb
deface-1.0.2 spec/deface/actions/insert_after_spec.rb