Sha256: f4f4acdfee3323c4e290693338f94ef010e4b66139279f87aa5ba4c4d459999c

Contents?: true

Size: 784 Bytes

Versions: 12

Compression:

Stored size: 784 Bytes

Contents

require 'spec_helper'

describe Alchemy::BaseController do

  describe '#store_user_request_time' do
    context "user not logged in" do
      before { allow(controller).to receive(:alchemy_user_signed_in?).and_return(false) }

      it "should not store the current request time" do
        expect(controller.send(:store_user_request_time)).to eq(nil)
      end
    end

    context "user logged in" do
      before do
        allow(controller).to receive(:alchemy_user_signed_in?).and_return(true)
        allow(controller).to receive(:current_alchemy_user).and_return(mock_model('User', store_request_time!: true))
      end

      it "should not store the current request time" do
        expect(controller.send(:store_user_request_time)).to eq(true)
      end
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
alchemy-devise-4.2.0 spec/controllers/base_controller_spec.rb
alchemy-devise-4.1.0 spec/controllers/base_controller_spec.rb
alchemy-devise-4.1.0.beta spec/controllers/base_controller_spec.rb
alchemy-devise-4.0.0 spec/controllers/base_controller_spec.rb
alchemy-devise-3.6.0 spec/controllers/base_controller_spec.rb
alchemy-devise-3.5.0 spec/controllers/base_controller_spec.rb
alchemy-devise-3.5.0.beta spec/controllers/base_controller_spec.rb
alchemy-devise-3.4.0 spec/controllers/base_controller_spec.rb
alchemy-devise-3.3.0 spec/controllers/base_controller_spec.rb
alchemy-devise-3.2.0 spec/controllers/base_controller_spec.rb
alchemy-devise-2.1.0 spec/controllers/base_controller_spec.rb
alchemy-devise-2.1.0.beta3 spec/controllers/base_controller_spec.rb