Sha256: 9a5133f51590bcdfdae89cee79d868635bafa05fcb5fb83052b508ca0434ff83
Contents?: true
Size: 869 Bytes
Versions: 1
Compression:
Stored size: 869 Bytes
Contents
require 'test_helper' class ImpersonationTest < ActionController::IntegrationTest context 'When impersonating another user' do setup do @bob = Factory(:user, :email => 'bob@bob.bob', :display_name => 'Bobby') @admin_user = Factory(:admin_user, :email => 'admin@twongo.com') sign_in_as @admin_user.email, @admin_user.password impersonate(@bob) end should 'be signed in' do assert controller.signed_in? end should 'be logged in as bob' do assert_equal controller.current_user, @bob end should 'be able to go back to the original admin user' do delete impersonate_url assert controller.signed_in? assert_equal controller.current_user, @admin_user end end private def impersonate(user) post impersonate_url(user) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
blue_light_special-0.2.0 | test/rails_root/test/integration/impersonation_test.rb |