rules_engine_users 0.0.1 → 0.0.2
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.
- data/VERSION +1 -1
- data/lib/rules_engine/controller_users.rb +3 -3
- data/rails_generators/manifests/rules_engine_users.rb +15 -3
- data/rails_generators/manifests/rules_engine_users.yml +4 -3
- data/rails_generators/templates/app/controllers/admin/users_controller.rb +2 -0
- data/rails_generators/templates/app/controllers/users_controller.rb +81 -5
- data/rails_generators/templates/app/models/user_mailer.rb +1 -1
- data/rails_generators/templates/app/models/user_observer.rb +1 -0
- data/rails_generators/templates/app/views/users/_login_form.html.erb +24 -0
- data/rails_generators/templates/app/views/users/_pswd_forgot_form.html.erb +22 -0
- data/rails_generators/templates/app/views/users/_signup_form.html.erb +26 -0
- data/rails_generators/templates/app/views/users/change_form.html.erb +5 -9
- data/rails_generators/templates/app/views/users/details.html.erb +1 -0
- data/rails_generators/templates/app/views/users/login_form.html.erb +8 -22
- data/rails_generators/templates/app/views/users/login_form.js.erb +37 -0
- data/rails_generators/templates/app/views/users/pswd_change_form.html.erb +5 -8
- data/rails_generators/templates/app/views/users/pswd_forgot_form.html.erb +13 -18
- data/rails_generators/templates/app/views/users/pswd_forgot_form.js.erb +29 -0
- data/rails_generators/templates/app/views/users/pswd_reset_form.html.erb +3 -8
- data/rails_generators/templates/app/views/users/signup_form.html.erb +13 -0
- data/rails_generators/templates/app/views/users/signup_form.js.erb +29 -0
- data/rails_generators/templates/app/views/users/welcome_form.html.erb +3 -7
- data/rails_generators/templates/config/initializers/rules_engine_users.rb +4 -0
- data/rails_generators/templates/db/migrate/20100104014507_create_users.rb +1 -1
- data/rails_generators/templates/doc/README.rules_engine_users +83 -76
- data/rails_generators/templates/spec/controllers/users_controller_spec.rb +312 -183
- data/rails_generators/templates/spec/models/user_mailer_spec.rb +1 -1
- data/rails_generators/templates/{features/support/blueprint_users.rb → spec/support/rules_engine_users_blueprints.rb} +0 -0
- data/rails_generators/templates/spec/support/rules_engine_users_macros.rb +16 -0
- data/spec/rules_engine/controller_users_spec.rb +3 -3
- metadata +17 -13
- data/.document +0 -5
- data/.gitignore +0 -22
- data/Rakefile +0 -47
- data/rails_generators/templates/spec/support/rules_engine_macros.rb +0 -16
- data/rules_engine_users.gemspec +0 -141
@@ -19,7 +19,7 @@ describe UserMailer do
|
|
19
19
|
it "should include direct link to create a password" do
|
20
20
|
RulesEngine::ControllerUserMail.host = "my.server.name"
|
21
21
|
mail = UserMailer.deliver_welcome_message(@valid_options)
|
22
|
-
mail.body.should =~ /http:\/\/my.server.name\/user\/
|
22
|
+
mail.body.should =~ /http:\/\/my.server.name\/user\/welcome\?token=test_token/
|
23
23
|
end
|
24
24
|
|
25
25
|
end
|
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module RulesEngineUsersMacros
|
2
|
+
|
3
|
+
def it_should_require_admin_access(*action)
|
4
|
+
it "should require admin access for #{action[0]}" do
|
5
|
+
controller.should_receive(:admin_access_required)
|
6
|
+
get *action
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def it_should_require_login(*action)
|
11
|
+
it "should require login access for #{action[0]}" do
|
12
|
+
controller.should_receive(:login_required)
|
13
|
+
get *action
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -236,19 +236,19 @@ describe "ControllerUsers", :type => :controller do
|
|
236
236
|
it "should pass if the current user has the access level" do
|
237
237
|
@current_user.stub!(:access_level).and_return(200)
|
238
238
|
controller.should be_logged_in
|
239
|
-
controller.should
|
239
|
+
controller.should be_reporter
|
240
240
|
end
|
241
241
|
|
242
242
|
it "should pass if the current user has an access level greater than that required" do
|
243
243
|
@current_user.stub!(:access_level).and_return(201)
|
244
244
|
controller.should be_logged_in
|
245
|
-
controller.should
|
245
|
+
controller.should be_reporter
|
246
246
|
end
|
247
247
|
|
248
248
|
it "should fail if the current user has an access level less than that required" do
|
249
249
|
@current_user.stub!(:access_level).and_return(199)
|
250
250
|
controller.should be_logged_in
|
251
|
-
controller.should_not
|
251
|
+
controller.should_not be_reporter
|
252
252
|
end
|
253
253
|
end
|
254
254
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rules_engine_users
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chris Douglas
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-08-26 00:00:00 +10:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
version: 1.2.9
|
35
35
|
type: :development
|
36
36
|
version_requirements: *id001
|
37
|
-
description: Manage users and authentication
|
37
|
+
description: Manage rules engine users and authentication
|
38
38
|
email: dougo.chris@gmail.com
|
39
39
|
executables: []
|
40
40
|
|
@@ -44,11 +44,8 @@ extra_rdoc_files:
|
|
44
44
|
- LICENSE
|
45
45
|
- README.rdoc
|
46
46
|
files:
|
47
|
-
- .document
|
48
|
-
- .gitignore
|
49
47
|
- LICENSE
|
50
48
|
- README.rdoc
|
51
|
-
- Rakefile
|
52
49
|
- VERSION
|
53
50
|
- init.rb
|
54
51
|
- lib/rules_engine/controller_user_mail.rb
|
@@ -70,13 +67,21 @@ files:
|
|
70
67
|
- rails_generators/templates/app/views/admin/users/show.html.erb
|
71
68
|
- rails_generators/templates/app/views/user_mailer/forgot_password.html.erb
|
72
69
|
- rails_generators/templates/app/views/user_mailer/welcome_message.html.erb
|
70
|
+
- rails_generators/templates/app/views/users/_login_form.html.erb
|
71
|
+
- rails_generators/templates/app/views/users/_pswd_forgot_form.html.erb
|
72
|
+
- rails_generators/templates/app/views/users/_signup_form.html.erb
|
73
73
|
- rails_generators/templates/app/views/users/change_form.html.erb
|
74
74
|
- rails_generators/templates/app/views/users/details.html.erb
|
75
75
|
- rails_generators/templates/app/views/users/login_form.html.erb
|
76
|
+
- rails_generators/templates/app/views/users/login_form.js.erb
|
76
77
|
- rails_generators/templates/app/views/users/pswd_change_form.html.erb
|
77
78
|
- rails_generators/templates/app/views/users/pswd_forgot_form.html.erb
|
79
|
+
- rails_generators/templates/app/views/users/pswd_forgot_form.js.erb
|
78
80
|
- rails_generators/templates/app/views/users/pswd_reset_form.html.erb
|
81
|
+
- rails_generators/templates/app/views/users/signup_form.html.erb
|
82
|
+
- rails_generators/templates/app/views/users/signup_form.js.erb
|
79
83
|
- rails_generators/templates/app/views/users/welcome_form.html.erb
|
84
|
+
- rails_generators/templates/config/initializers/rules_engine_users.rb
|
80
85
|
- rails_generators/templates/db/migrate/20100104014507_create_users.rb
|
81
86
|
- rails_generators/templates/doc/README.rules_engine_users
|
82
87
|
- rails_generators/templates/doc/README.rules_engine_users_paths
|
@@ -87,7 +92,6 @@ files:
|
|
87
92
|
- rails_generators/templates/features/admin/user/step_definitions/edit_steps.rb
|
88
93
|
- rails_generators/templates/features/admin/user/step_definitions/index_steps.rb
|
89
94
|
- rails_generators/templates/features/admin/user/step_definitions/show_steps.rb
|
90
|
-
- rails_generators/templates/features/support/blueprint_users.rb
|
91
95
|
- rails_generators/templates/features/user/change.feature
|
92
96
|
- rails_generators/templates/features/user/details.feature
|
93
97
|
- rails_generators/templates/features/user/login.feature
|
@@ -103,8 +107,8 @@ files:
|
|
103
107
|
- rails_generators/templates/spec/models/user_mailer_spec.rb
|
104
108
|
- rails_generators/templates/spec/models/user_observer_spec.rb
|
105
109
|
- rails_generators/templates/spec/models/user_spec.rb
|
106
|
-
- rails_generators/templates/spec/support/
|
107
|
-
-
|
110
|
+
- rails_generators/templates/spec/support/rules_engine_users_blueprints.rb
|
111
|
+
- rails_generators/templates/spec/support/rules_engine_users_macros.rb
|
108
112
|
- spec/railsenv/app/controllers/application_controller.rb
|
109
113
|
- spec/railsenv/config/boot.rb
|
110
114
|
- spec/railsenv/config/database.yml
|
@@ -132,7 +136,7 @@ has_rdoc: true
|
|
132
136
|
homepage: http://github.com/dougochris/rules_engine_users
|
133
137
|
licenses: []
|
134
138
|
|
135
|
-
post_install_message:
|
139
|
+
post_install_message: "\n *** RUN script/generate rules_engine_users\n "
|
136
140
|
rdoc_options:
|
137
141
|
- --charset=UTF-8
|
138
142
|
require_paths:
|
@@ -161,7 +165,7 @@ rubyforge_project:
|
|
161
165
|
rubygems_version: 1.3.7
|
162
166
|
signing_key:
|
163
167
|
specification_version: 3
|
164
|
-
summary: Manage users and authentication
|
168
|
+
summary: Manage rules engine users and authentication
|
165
169
|
test_files:
|
166
170
|
- spec/railsenv/app/controllers/application_controller.rb
|
167
171
|
- spec/railsenv/config/boot.rb
|
data/.document
DELETED
data/.gitignore
DELETED
data/Rakefile
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake'
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = "rules_engine_users"
|
8
|
-
gem.summary = %Q{Manage users and authentication}
|
9
|
-
gem.description = %Q{Manage users and authentication}
|
10
|
-
gem.email = "dougo.chris@gmail.com"
|
11
|
-
gem.homepage = "http://github.com/dougochris/rules_engine_users"
|
12
|
-
gem.authors = ["Chris Douglas"]
|
13
|
-
gem.add_development_dependency "rspec", ">= 1.2.9"
|
14
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
|
-
end
|
16
|
-
Jeweler::GemcutterTasks.new
|
17
|
-
rescue LoadError
|
18
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
19
|
-
end
|
20
|
-
|
21
|
-
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
|
22
|
-
|
23
|
-
require 'spec/rake/spectask'
|
24
|
-
Spec::Rake::SpecTask.new(:spec) do |spec|
|
25
|
-
spec.libs << 'lib' << 'spec'
|
26
|
-
spec.spec_files = FileList['spec/**/*_spec.rb']
|
27
|
-
end
|
28
|
-
|
29
|
-
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
30
|
-
spec.libs << 'lib' << 'spec'
|
31
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
32
|
-
spec.rcov = true
|
33
|
-
end
|
34
|
-
|
35
|
-
task :spec => :check_dependencies
|
36
|
-
|
37
|
-
task :default => :spec
|
38
|
-
|
39
|
-
require 'rake/rdoctask'
|
40
|
-
Rake::RDocTask.new do |rdoc|
|
41
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
42
|
-
|
43
|
-
rdoc.rdoc_dir = 'rdoc'
|
44
|
-
rdoc.title = "rules_engine_users #{version}"
|
45
|
-
rdoc.rdoc_files.include('README*')
|
46
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
47
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module RulesEngineMacros
|
2
|
-
|
3
|
-
def it_should_require_rules_engine_reader_access(*action)
|
4
|
-
it "should require rules engine reader access for #{action[0]}" do
|
5
|
-
controller.should_receive(:rules_engine_reader_access_required)
|
6
|
-
get *action
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
def it_should_require_rules_engine_editor_access(*action)
|
11
|
-
it "should require rules engine editor access for #{action[0]}" do
|
12
|
-
controller.should_receive(:rules_engine_editor_access_required)
|
13
|
-
get *action
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
data/rules_engine_users.gemspec
DELETED
@@ -1,141 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{rules_engine_users}
|
8
|
-
s.version = "0.0.1"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Chris Douglas"]
|
12
|
-
s.date = %q{2010-06-29}
|
13
|
-
s.description = %q{Manage users and authentication}
|
14
|
-
s.email = %q{dougo.chris@gmail.com}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE",
|
17
|
-
"README.rdoc"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".gitignore",
|
22
|
-
"LICENSE",
|
23
|
-
"README.rdoc",
|
24
|
-
"Rakefile",
|
25
|
-
"VERSION",
|
26
|
-
"init.rb",
|
27
|
-
"lib/rules_engine/controller_user_mail.rb",
|
28
|
-
"lib/rules_engine/controller_users.rb",
|
29
|
-
"lib/rules_engine_users.rb",
|
30
|
-
"rails_generators/USAGE",
|
31
|
-
"rails_generators/manifests/rules_engine_users.rb",
|
32
|
-
"rails_generators/manifests/rules_engine_users.yml",
|
33
|
-
"rails_generators/rules_engine_users_generator.rb",
|
34
|
-
"rails_generators/templates/app/controllers/admin/users_controller.rb",
|
35
|
-
"rails_generators/templates/app/controllers/users_controller.rb",
|
36
|
-
"rails_generators/templates/app/models/user.rb",
|
37
|
-
"rails_generators/templates/app/models/user_mailer.rb",
|
38
|
-
"rails_generators/templates/app/models/user_observer.rb",
|
39
|
-
"rails_generators/templates/app/views/admin/users/_form.html.erb",
|
40
|
-
"rails_generators/templates/app/views/admin/users/edit.html.erb",
|
41
|
-
"rails_generators/templates/app/views/admin/users/index.html.erb",
|
42
|
-
"rails_generators/templates/app/views/admin/users/new.html.erb",
|
43
|
-
"rails_generators/templates/app/views/admin/users/show.html.erb",
|
44
|
-
"rails_generators/templates/app/views/user_mailer/forgot_password.html.erb",
|
45
|
-
"rails_generators/templates/app/views/user_mailer/welcome_message.html.erb",
|
46
|
-
"rails_generators/templates/app/views/users/change_form.html.erb",
|
47
|
-
"rails_generators/templates/app/views/users/details.html.erb",
|
48
|
-
"rails_generators/templates/app/views/users/login_form.html.erb",
|
49
|
-
"rails_generators/templates/app/views/users/pswd_change_form.html.erb",
|
50
|
-
"rails_generators/templates/app/views/users/pswd_forgot_form.html.erb",
|
51
|
-
"rails_generators/templates/app/views/users/pswd_reset_form.html.erb",
|
52
|
-
"rails_generators/templates/app/views/users/welcome_form.html.erb",
|
53
|
-
"rails_generators/templates/db/migrate/20100104014507_create_users.rb",
|
54
|
-
"rails_generators/templates/doc/README.rules_engine_users",
|
55
|
-
"rails_generators/templates/doc/README.rules_engine_users_paths",
|
56
|
-
"rails_generators/templates/features/admin/user/edit.feature",
|
57
|
-
"rails_generators/templates/features/admin/user/index.feature",
|
58
|
-
"rails_generators/templates/features/admin/user/new.feature",
|
59
|
-
"rails_generators/templates/features/admin/user/show.feature",
|
60
|
-
"rails_generators/templates/features/admin/user/step_definitions/edit_steps.rb",
|
61
|
-
"rails_generators/templates/features/admin/user/step_definitions/index_steps.rb",
|
62
|
-
"rails_generators/templates/features/admin/user/step_definitions/show_steps.rb",
|
63
|
-
"rails_generators/templates/features/support/blueprint_users.rb",
|
64
|
-
"rails_generators/templates/features/user/change.feature",
|
65
|
-
"rails_generators/templates/features/user/details.feature",
|
66
|
-
"rails_generators/templates/features/user/login.feature",
|
67
|
-
"rails_generators/templates/features/user/pswd_change.feature",
|
68
|
-
"rails_generators/templates/features/user/pswd_forgot.feature",
|
69
|
-
"rails_generators/templates/features/user/pswd_reset.feature",
|
70
|
-
"rails_generators/templates/features/user/step_definitions/login_steps.rb",
|
71
|
-
"rails_generators/templates/features/user/step_definitions/pswd_reset_steps.rb",
|
72
|
-
"rails_generators/templates/features/user/step_definitions/welcome_steps.rb",
|
73
|
-
"rails_generators/templates/features/user/welcome.feature",
|
74
|
-
"rails_generators/templates/spec/controllers/admin/users_controller_spec.rb",
|
75
|
-
"rails_generators/templates/spec/controllers/users_controller_spec.rb",
|
76
|
-
"rails_generators/templates/spec/models/user_mailer_spec.rb",
|
77
|
-
"rails_generators/templates/spec/models/user_observer_spec.rb",
|
78
|
-
"rails_generators/templates/spec/models/user_spec.rb",
|
79
|
-
"rails_generators/templates/spec/support/rules_engine_macros.rb",
|
80
|
-
"rules_engine_users.gemspec",
|
81
|
-
"spec/railsenv/app/controllers/application_controller.rb",
|
82
|
-
"spec/railsenv/config/boot.rb",
|
83
|
-
"spec/railsenv/config/database.yml",
|
84
|
-
"spec/railsenv/config/environment.rb",
|
85
|
-
"spec/railsenv/config/environments/development.rb",
|
86
|
-
"spec/railsenv/config/environments/production.rb",
|
87
|
-
"spec/railsenv/config/environments/test.rb",
|
88
|
-
"spec/railsenv/config/initializers/backtrace_silencers.rb",
|
89
|
-
"spec/railsenv/config/initializers/inflections.rb",
|
90
|
-
"spec/railsenv/config/initializers/mime_types.rb",
|
91
|
-
"spec/railsenv/config/initializers/new_rails_defaults.rb",
|
92
|
-
"spec/railsenv/config/initializers/session_store.rb",
|
93
|
-
"spec/railsenv/config/locales/en.yml",
|
94
|
-
"spec/railsenv/config/routes.rb",
|
95
|
-
"spec/railsenv/db/test.sqlite3",
|
96
|
-
"spec/railsenv/log/debug.log",
|
97
|
-
"spec/railsenv/log/test.log",
|
98
|
-
"spec/rcov.opts",
|
99
|
-
"spec/rules_engine/controller_user_mail_spec.rb",
|
100
|
-
"spec/rules_engine/controller_users_spec.rb",
|
101
|
-
"spec/spec.opts",
|
102
|
-
"spec/spec_helper.rb",
|
103
|
-
"tasks/rspec.rake"
|
104
|
-
]
|
105
|
-
s.homepage = %q{http://github.com/dougochris/rules_engine_users}
|
106
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
107
|
-
s.require_paths = ["lib"]
|
108
|
-
s.rubygems_version = %q{1.3.7}
|
109
|
-
s.summary = %q{Manage users and authentication}
|
110
|
-
s.test_files = [
|
111
|
-
"spec/railsenv/app/controllers/application_controller.rb",
|
112
|
-
"spec/railsenv/config/boot.rb",
|
113
|
-
"spec/railsenv/config/environment.rb",
|
114
|
-
"spec/railsenv/config/environments/development.rb",
|
115
|
-
"spec/railsenv/config/environments/production.rb",
|
116
|
-
"spec/railsenv/config/environments/test.rb",
|
117
|
-
"spec/railsenv/config/initializers/backtrace_silencers.rb",
|
118
|
-
"spec/railsenv/config/initializers/inflections.rb",
|
119
|
-
"spec/railsenv/config/initializers/mime_types.rb",
|
120
|
-
"spec/railsenv/config/initializers/new_rails_defaults.rb",
|
121
|
-
"spec/railsenv/config/initializers/session_store.rb",
|
122
|
-
"spec/railsenv/config/routes.rb",
|
123
|
-
"spec/rules_engine/controller_user_mail_spec.rb",
|
124
|
-
"spec/rules_engine/controller_users_spec.rb",
|
125
|
-
"spec/spec_helper.rb"
|
126
|
-
]
|
127
|
-
|
128
|
-
if s.respond_to? :specification_version then
|
129
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
130
|
-
s.specification_version = 3
|
131
|
-
|
132
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
133
|
-
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
134
|
-
else
|
135
|
-
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
136
|
-
end
|
137
|
-
else
|
138
|
-
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|