I am trying to test a padrino controller which depends on the current_account provided by Padrino :: Admin :: AccessControl
To do this, I need mock current_account.
the code looks something like this:
App.controller :post do post :create, map => '/create' do Post.create :user => current_account end end
and rspec:
describe "Post creation" do it 'should create' do account = Account.create :name => 'someone' loggin_as account
How can I implement "loggin_as" or how can I write this test?
source share