Module: Toni::RSpecHelper

Extended by:
RSpec::Matchers::DSL
Defined in:
lib/toni/rspec_helper.rb

Instance Method Summary collapse

Instance Method Details

#with_user(user, &block) ⇒ Object



8
9
10
11
12
13
# File 'lib/toni/rspec_helper.rb', line 8

def with_user(user, &block)
  Toni.current_user = user
  result = yield
  Toni.current_user = nil
  result
end

#without_authorization(&block) ⇒ Object



15
16
17
# File 'lib/toni/rspec_helper.rb', line 15

def without_authorization(&block)
  Toni.without_authorization(&block)
end