devise_masquerade 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of devise_masquerade might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGE2YzU4NTA5NmVhZjFkMjA5YzM0ODZkMDBhZWI5OWU0MTkwYjI4NQ==
4
+ Y2IwNTZiZjYzNWFkZDgxMWYyZTMzZmE2ZmI0M2FlZjZlN2ViMDk3ZQ==
5
5
  data.tar.gz: !binary |-
6
- NWYyMmJlZGRiZjMwOTYwMDgxNGEwNGZiYjkxNDkxMDg0NzdkOGUwNA==
6
+ MTE4OGQ3MDc4ZTM0NjUzNzE5Njg4YWJmMmEyNTNmYWNhMzRhZDYxYg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjkzYzMzZjczMDYzNzI1YzFmNDU0ODg4NTQ4ZWIzN2U0ODAxNzBiODMzNWM0
10
- OGIwNWM4YTRlZTVkNWNkZDZlNTA0NTE4OTU5NDE5YTBiMjhiY2IzOWVjMzZk
11
- NGNhYTRlODc2NzU0N2Q0OTY1NTQ4OTlmYmUwNmUwYjk1MmU2MzM=
9
+ YzE2MmNkMDc0NDIyYjk1ZGExMGFhYWNiMzEwYWQzMWY2OTE1Yjg2ODA0ZTY5
10
+ OTdjY2MyMWJmMmMyOGJkZDE5Y2I0ZDk1YmU1NWM0MTIzMjJjNzMwZDI3NmIw
11
+ NGY0ZmFmMjliNzAwYWM5MTFiZGE4MGI3YzUyOGE4NTA4ZDA3NmQ=
12
12
  data.tar.gz: !binary |-
13
- YjY5NmVmMGM0M2JlYmRlMDY2MTBhMDRlM2Y0MTg2MDg1N2Y3NGU5ZGEwNDNh
14
- YTYzNjI3Yjc2MWFhMjEzM2E2NTIyZWNmNGI5YjU1NDBhYjhmZDJkNzg3MTdk
15
- MDZkZTIxYWZkNTU0YWFhOThhODY3OTgyNzQ2YWE5ZWFjYTc1MDA=
13
+ NjFjYzA4OTg2Y2FhOWUxNjUzODJlMjYyZTAxNzFiMTZhZTdmZmI4NDM2YjUz
14
+ OTAyMzQ3NzY2Y2Y0OWY2OTZiNTFiYTcxZjIwOWZkYmFmOGUwZTU0YjJjNGM2
15
+ NDMxOTk1NDkyYjc4ZjRhMjdiYTViNjAzMmU4NzZiODkxMWVmMDc=
data/README.md CHANGED
@@ -90,6 +90,14 @@ helpers:
90
90
  And check http://localhost:3000/, use for login user1@example.com and
91
91
  'password'
92
92
 
93
+ ## Test project
94
+
95
+ cd spec/dummy
96
+ rake db:setup db:test:prepare
97
+ cd -
98
+ rspec
99
+
100
+
93
101
  ## Contributing
94
102
 
95
103
  1. Fork it
@@ -11,6 +11,8 @@ class Devise::MasqueradesController < DeviseController
11
11
 
12
12
  self.resource.masquerade!
13
13
 
14
+ sign_in(self.resource, :bypass => Devise.masquerade_bypass_warden_callback)
15
+
14
16
  redirect_to("#{after_masquerade_path_for(self.resource)}?#{after_masquerade_param_for(resource)}")
15
17
  end
16
18
 
@@ -1,3 +1,3 @@
1
1
  module DeviseMasquerade
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -12,31 +12,12 @@ describe Devise::MasqueradesController do
12
12
 
13
13
  before do
14
14
  SecureRandom.should_receive(:urlsafe_base64).and_return("secure_key")
15
-
16
15
  get :show, :id => mask.to_param
17
16
  end
18
17
 
19
18
  it { session.keys.should include('devise_masquerade_user') }
19
+ it { session["warden.user.user.key"].first.first.should == mask.id }
20
20
  it { should redirect_to("/?masquerade=secure_key") }
21
- end
22
- end
23
-
24
- context 'when not logged in' do
25
- before { get :show, :id => 'any_id' }
26
-
27
- it { should redirect_to(new_user_session_path) }
28
- end
29
-
30
- describe 'back to the owner of the request' do
31
- before { logged_in }
32
-
33
- context 'and masquerade user' do
34
- let(:mask) { create(:user) }
35
-
36
- before do
37
- SecureRandom.should_receive(:urlsafe_base64).and_return("secure_key")
38
- get :show, :id => mask.to_param
39
- end
40
21
 
41
22
  context 'and back' do
42
23
  before { get :back }
@@ -47,6 +28,12 @@ describe Devise::MasqueradesController do
47
28
  end
48
29
  end
49
30
  end
31
+
32
+ context 'when not logged in' do
33
+ before { get :show, :id => 'any_id' }
34
+
35
+ it { should redirect_to(new_user_session_path) }
36
+ end
50
37
  end
51
38
 
52
39
  # it's a page with masquerade button ("Login As")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_masquerade
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandr Korsak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-19 00:00:00.000000000 Z
11
+ date: 2014-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler