Sha256: 7cc76f439d1de888f52cc3916e4b6811f27ccfdad221f1b29d4a164eaffccfae

Contents?: true

Size: 777 Bytes

Versions: 9

Compression:

Stored size: 777 Bytes

Contents

# encoding: utf-8
#
# This file is part of the brauser gem. Copyright (C) 2013 and above Shogun <shogun_panda@me.com>.
# Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
#

require "spec_helper"

describe Brauser::Hooks::RubyOnRails do
  let(:controller){::ActionController::Base.new}

  it "should append to ActionController::Base" do
    expect(::ActionController::Base.new.respond_to?(:browser)).to be_true
  end

  it "should memoize browser" do
    browser = controller.browser
    expect(browser).to be_a(::Brauser::Browser)
    expect(controller.browser).to eq(browser)
  end

  it "should detect browser again" do
    browser = controller.browser
    expect(controller.browser(true)).not_to eq(browser)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
brauser-3.1.6 spec/brauser/hooks_spec.rb
brauser-3.1.5 spec/brauser/hooks_spec.rb
brauser-3.1.4 spec/brauser/hooks_spec.rb
brauser-3.1.3 spec/brauser/hooks_spec.rb
brauser-3.1.2 spec/brauser/hooks_spec.rb
brauser-3.1.1 spec/brauser/hooks_spec.rb
brauser-3.1.0 spec/brauser/hooks_spec.rb
brauser-3.0.1 spec/brauser/hooks_spec.rb
brauser-3.0.0 spec/brauser/hooks_spec.rb