require 'spec_helper' module Deface module Actions describe InsertTop do include_context "mock Rails.application" before { Dummy.all.clear } describe "with a single insert_top override defined" do before { Deface::Override.new(:virtual_path => "posts/index", :name => "Posts#index", :insert_top => "ul", :text => "
  • me first
  • ") } let(:source) { "" } it "should return modified source" do Dummy.apply(source, {:virtual_path => "posts/index"}).gsub("\n", "").should == "" end end describe "with a single insert_top override defined when targetted elemenet has no children" do before { Deface::Override.new(:virtual_path => "posts/index", :name => "Posts#index", :insert_top => "ul", :text => "
  • first
  • second
  • third
  • ") } let(:source) { "" } it "should return modified source" do Dummy.apply(source, {:virtual_path => "posts/index"}).gsub("\n", "").should == "" end end end end end