mirror of
https://github.com/awesome-print/awesome_print
synced 2023-03-27 23:22:34 -04:00
60a8498e28
* Added rails 6.0 and 6.1 to travis * Added rails 6 support files * Added data for rais 6.x tests * Rails 6 date helper includes float seconds * Updated actionview test for rails 6.1 Co-authored-by: Bryan Hanks, PMP <bryan@master-developer.com>
21 lines
734 B
Ruby
21 lines
734 B
Ruby
require 'spec_helper'
|
|
|
|
RSpec.describe 'AwesomePrint ActionView extensions', skip: -> { !ExtVerifier.has_rails? }.call do
|
|
before do
|
|
@view = if rails_6_1?
|
|
ActionView::Base.new(ActionView::LookupContext.new([]), {}, {})
|
|
else
|
|
ActionView::Base.new
|
|
end
|
|
end
|
|
|
|
it "uses HTML and adds 'debug_dump' class to plain <pre> tag" do
|
|
markup = rand
|
|
expect(@view.ap(markup, plain: true)).to eq(%Q|<pre class="debug_dump">#{markup}</pre>|)
|
|
end
|
|
|
|
it "uses HTML and adds 'debug_dump' class to colorized <pre> tag" do
|
|
markup = ' &<hello>'
|
|
expect(@view.ap(markup)).to eq('<pre class="debug_dump"><kbd style="color:brown">" &<hello>"</kbd></pre>')
|
|
end
|
|
end
|