Sha256: f0e9527b0121373958f3436b29951f680f25ded60b9e0fb23dd1f017cf0e3b30

Contents?: true

Size: 788 Bytes

Versions: 2

Compression:

Stored size: 788 Bytes

Contents

require "spec_helper"

RSpec.describe UniformNotifier::JavascriptConsole do
  it "should not notify message" do
    expect(UniformNotifier::JavascriptConsole.inline_notify(:title => "javascript console!")).to be_nil
  end

  it "should notify message" do
    UniformNotifier.console = true
    expect(UniformNotifier::JavascriptConsole.inline_notify(:title => "javascript console!")).to eq <<-CODE
<script type="text/javascript">/*<![CDATA[*/
if (typeof(console) !== 'undefined' && console.log) {
  if (console.groupCollapsed && console.groupEnd) {
    console.groupCollapsed(#{"Uniform Notifier".inspect});
    console.log(#{"javascript console!".inspect});
    console.groupEnd();
  } else {
    console.log(#{"javascript console!".inspect});
  }
}

/*]]>*/</script>
    CODE
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
uniform_notifier-1.11.0 spec/uniform_notifier/javascript_console_spec.rb
uniform_notifier-1.10.0 spec/uniform_notifier/javascript_console_spec.rb