Sha256: 391875ccf42e7e3e13fa5a0d4698e552e885e613a548e0f5903e383422a99f39
Contents?: true
Size: 694 Bytes
Versions: 8
Compression:
Stored size: 694 Bytes
Contents
require 'spec_helper' require 'thoth/rails/railtie' DummyUser = Struct.new(:id) class ControllerWithThothContextController < ActionController::Base include Thoth::Rails::ControllerContext def show @context = Thoth.context head 200 end def current_user DummyUser.new(1) end end describe ControllerWithThothContextController, type: :controller do before do routes.draw { get "show" => "controller_with_thoth_context#show" } end context "on any action" do it "stores params in the Thoth.context" do get :show expect(assigns(:context)).to eq({"controller"=>"controller_with_thoth_context", "action"=>"show", "current_user"=>1}) end end end
Version data entries
8 entries across 8 versions & 1 rubygems