devise_masquerade 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

data/README.md CHANGED
@@ -33,6 +33,13 @@ Add into your application_controller.rb:
33
33
 
34
34
  Instead of user you can use your resource name admin, student or another names.
35
35
 
36
+ If you want to back to the owner of masquerade action user you could use
37
+ helpers:
38
+
39
+ user_masquerade? # current user was masqueraded by owner?
40
+
41
+ = link_to "Reverse masquerade", back_masquerade_path(current_user)
42
+
36
43
  ## Custom controller for adding cancan for authorization
37
44
 
38
45
  class Admin::MasqueradesController < Devise::MasqueradesController
@@ -65,6 +72,15 @@ Instead of user you can use your resource name admin, student or another names.
65
72
  Devise.masquerade_expires_in = 10.seconds
66
73
  Devise.masquerade_key_size = 16 # size of the generate by SecureRandom.base64
67
74
 
75
+ ## Demo project
76
+
77
+ cd spec/dummy
78
+ rake db:setup
79
+ rails server
80
+
81
+ And check http://localhost:3000/, use for login user1@example.com and
82
+ 'password'
83
+
68
84
  ## Contributing
69
85
 
70
86
  1. Fork it
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
3
  task :default do
4
- system 'bundle exec rspec spec/'
4
+ system 'bundle exec rspec && bundle exec cucumber'
5
5
  end
6
6
 
@@ -3,7 +3,6 @@ Feature: Use back button for returning to the owner of the masquerade action.
3
3
  As an masquerade user
4
4
  I want to be able to press a simple button on the page
5
5
 
6
- @devise
7
6
  Scenario: Use back button
8
7
  Given I logged in
9
8
  And I have a user for masquerade
@@ -1,3 +1,3 @@
1
1
  module DeviseMasquerade
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -0,0 +1,3 @@
1
+ User.create!(:email => "user1@example.com", :password => "password", :password_confirmation => "password")
2
+ User.create!(:email => "user2@example.com", :password => "password", :password_confirmation => "password")
3
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_masquerade
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -118,6 +118,7 @@ files:
118
118
  - spec/dummy/config/routes.rb
119
119
  - spec/dummy/db/migrate/20121119085620_devise_create_users.rb
120
120
  - spec/dummy/db/schema.rb
121
+ - spec/dummy/db/seeds.rb
121
122
  - spec/dummy/public/.empty
122
123
  - spec/dummy/script/rails
123
124
  - spec/models/user_spec.rb
@@ -183,6 +184,7 @@ test_files:
183
184
  - spec/dummy/config/routes.rb
184
185
  - spec/dummy/db/migrate/20121119085620_devise_create_users.rb
185
186
  - spec/dummy/db/schema.rb
187
+ - spec/dummy/db/seeds.rb
186
188
  - spec/dummy/public/.empty
187
189
  - spec/dummy/script/rails
188
190
  - spec/models/user_spec.rb