|
|
@ -331,11 +331,26 @@ class InternalUrlsFilterTest < MiniTest::Spec
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
context "context[:follow_links] is a block" do
|
|
|
|
context "context[:follow_links]" do
|
|
|
|
before do
|
|
|
|
before do
|
|
|
|
@body = link_to context[:url]
|
|
|
|
@body = link_to context[:url]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when it is false" do
|
|
|
|
|
|
|
|
before do
|
|
|
|
|
|
|
|
context[:follow_links] = false
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "doesn't set :internal_urls" do
|
|
|
|
|
|
|
|
refute internal_urls
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "replaces urls" do
|
|
|
|
|
|
|
|
refute_equal @body, filter_output_string
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when it is a block" do
|
|
|
|
it "calls the block with the filter instance" do
|
|
|
|
it "calls the block with the filter instance" do
|
|
|
|
context[:follow_links] = ->(arg) { @arg = arg; nil }
|
|
|
|
context[:follow_links] = ->(arg) { @arg = arg; nil }
|
|
|
|
filter.call
|
|
|
|
filter.call
|
|
|
@ -366,6 +381,7 @@ class InternalUrlsFilterTest < MiniTest::Spec
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
context "context[:skip_link] is a block" do
|
|
|
|
context "context[:skip_link] is a block" do
|
|
|
|
before do
|
|
|
|
before do
|
|
|
|