require 'spec_helper' module Deface module Actions describe Remove do include_context "mock Rails.application" before { Dummy.all.clear } describe "with a single remove override defined" do before { Deface::Override.new(:virtual_path => "posts/index", :name => "Posts#index", :remove => "p", :text => "

Argh!

") } let(:source) { "

test

<%= raw(text) %>" } it "should return modified source" do Dummy.apply(source, {:virtual_path => "posts/index"}).should == "<%= raw(text) %>" end end describe "with a single remove override with closing_selector defined" do before { Deface::Override.new(:virtual_path => "posts/index", :name => "Posts#index", :remove => "h1", :closing_selector => "h2") } let(:source) { "

I should be safe

Before!

start

some junk

more junk

end

After!" } it "should return modified source" do Dummy.apply(source, {:virtual_path => "posts/index"}).should == "

I should be safe

Before!After!" end end end end end