Sha256: 4d9206ff5186919b1b30e18882012c47ffc60277b3e23be9a58e88caa99f5171

Contents?: true

Size: 231 Bytes

Versions: 32

Compression:

Stored size: 231 Bytes

Contents

module ControllerMacros
  def login_as_user factory
    before(:each) do
      @request.env["devise.mapping"] = Devise.mappings[:admin]
      sign_in FactoryGirl.create(factory) # Using factory girl as an example
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
releaf-1.1.2 spec/support/controller_macros.rb
releaf-1.1.1 spec/support/controller_macros.rb
releaf-1.1.0 spec/support/controller_macros.rb
releaf-1.0.10 spec/support/controller_macros.rb
releaf-1.0.9 spec/support/controller_macros.rb
releaf-1.0.8 spec/support/controller_macros.rb
releaf-1.0.7 spec/support/controller_macros.rb
releaf-1.0.6 spec/support/controller_macros.rb
releaf-1.0.5 spec/support/controller_macros.rb
releaf-1.0.4 spec/support/controller_macros.rb
releaf-1.0.3 spec/support/controller_macros.rb
releaf-1.0.2 spec/support/controller_macros.rb