Sha256: 4a3f82a47cbfaa9714126a96ab560eda9e1259be0e8064e996b26fd98c6387c5

Contents?: true

Size: 562 Bytes

Versions: 30

Compression:

Stored size: 562 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module WardenTestHelpers
    include Warden::Test::Helpers

    #
    # Utility method to login in the middle of a test as a different user from
    # the current one.
    #
    def relogin_as(user, scope: :user)
      logout scope

      login_as user, scope: scope
    end
  end
end

RSpec.configure do |config|
  config.include Decidim::WardenTestHelpers, type: :system
  config.include Devise::Test::ControllerHelpers, type: :controller

  config.after :each, type: :system do
    Warden.test_reset!
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
decidim-dev-0.18.1 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.17.2 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.18.0 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.17.1 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.16.1 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.17.0 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.16.0 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.15.2 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.15.1 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.15.0 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.14.4 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.14.3 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.14.2 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.14.1 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.13.1 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.12.2 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.13.0 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.12.1 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.13.0.pre1 lib/decidim/dev/test/rspec_support/warden.rb
decidim-dev-0.12.0 lib/decidim/dev/test/rspec_support/warden.rb