active_directory_login 0.0.6 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +137 -0
- data/lib/active_directory_login/version.rb +1 -1
- data/lib/devise/strategies/active_directory_authenticatable.rb +0 -1
- metadata +22 -31
- data/.gitignore +0 -19
- data/active_directory_login.gemspec +0 -35
- data/spec/active_directory_login_spec.rb +0 -47
- data/spec/client_spec.rb +0 -52
- data/spec/models/user.rb +0 -23
- data/spec/spec_helper.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a05bb0814a109e3cae079613db84dadad5296a63
|
4
|
+
data.tar.gz: b9955cf295d3e41c929d7bdfd2dcb8eb55ad39bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1186c55915c9338bbf6277686d8e3d9b3a7afbc9e624db59e0311166f52528f7241828275ee87b365e35e3b3520f82dcc54aec923944c15bdffa5737cd1b68db
|
7
|
+
data.tar.gz: 78972936fc0d7520472e84df5a952248372b8a31377e552d95da60fcd5e9cf5ae584ed2235afe3ac60045be6b4f615879fd002f774996bdbef85a5877ebb2990
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,137 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
active_directory_login (0.0.1)
|
5
|
+
datacom-net-ldap (= 0.5.0.datacom)
|
6
|
+
datacom_active_directory (= 1.5.5.datacom)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionmailer (4.0.3)
|
12
|
+
actionpack (= 4.0.3)
|
13
|
+
mail (~> 2.5.4)
|
14
|
+
actionpack (4.0.3)
|
15
|
+
activesupport (= 4.0.3)
|
16
|
+
builder (~> 3.1.0)
|
17
|
+
erubis (~> 2.7.0)
|
18
|
+
rack (~> 1.5.2)
|
19
|
+
rack-test (~> 0.6.2)
|
20
|
+
activemodel (4.0.3)
|
21
|
+
activesupport (= 4.0.3)
|
22
|
+
builder (~> 3.1.0)
|
23
|
+
activerecord (4.0.3)
|
24
|
+
activemodel (= 4.0.3)
|
25
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
26
|
+
activesupport (= 4.0.3)
|
27
|
+
arel (~> 4.0.0)
|
28
|
+
activerecord-deprecated_finders (1.0.3)
|
29
|
+
activesupport (4.0.3)
|
30
|
+
i18n (~> 0.6, >= 0.6.4)
|
31
|
+
minitest (~> 4.2)
|
32
|
+
multi_json (~> 1.3)
|
33
|
+
thread_safe (~> 0.1)
|
34
|
+
tzinfo (~> 0.3.37)
|
35
|
+
arel (4.0.2)
|
36
|
+
atomic (1.1.15)
|
37
|
+
bcrypt (3.1.7)
|
38
|
+
bcrypt-ruby (3.1.5)
|
39
|
+
bcrypt (>= 3.1.3)
|
40
|
+
builder (3.1.4)
|
41
|
+
coderay (1.1.0)
|
42
|
+
datacom-net-ldap (0.5.0.datacom)
|
43
|
+
datacom_active_directory (1.5.5.datacom)
|
44
|
+
datacom-net-ldap (= 0.5.0.datacom)
|
45
|
+
devise (3.0.0)
|
46
|
+
bcrypt-ruby (~> 3.0)
|
47
|
+
orm_adapter (~> 0.1)
|
48
|
+
railties (>= 3.2.6, < 5)
|
49
|
+
warden (~> 1.2.3)
|
50
|
+
diff-lcs (1.2.5)
|
51
|
+
erubis (2.7.0)
|
52
|
+
flexmock (1.3.3)
|
53
|
+
hike (1.2.3)
|
54
|
+
i18n (0.6.9)
|
55
|
+
mail (2.5.4)
|
56
|
+
mime-types (~> 1.16)
|
57
|
+
treetop (~> 1.4.8)
|
58
|
+
method_source (0.8.2)
|
59
|
+
mime-types (1.25.1)
|
60
|
+
minitest (4.7.5)
|
61
|
+
multi_json (1.8.4)
|
62
|
+
orm_adapter (0.5.0)
|
63
|
+
polyglot (0.3.4)
|
64
|
+
pry (0.9.12.6)
|
65
|
+
coderay (~> 1.0)
|
66
|
+
method_source (~> 0.8)
|
67
|
+
slop (~> 3.4)
|
68
|
+
rack (1.5.2)
|
69
|
+
rack-test (0.6.2)
|
70
|
+
rack (>= 1.0)
|
71
|
+
rails (4.0.3)
|
72
|
+
actionmailer (= 4.0.3)
|
73
|
+
actionpack (= 4.0.3)
|
74
|
+
activerecord (= 4.0.3)
|
75
|
+
activesupport (= 4.0.3)
|
76
|
+
bundler (>= 1.3.0, < 2.0)
|
77
|
+
railties (= 4.0.3)
|
78
|
+
sprockets-rails (~> 2.0.0)
|
79
|
+
railties (4.0.3)
|
80
|
+
actionpack (= 4.0.3)
|
81
|
+
activesupport (= 4.0.3)
|
82
|
+
rake (>= 0.8.7)
|
83
|
+
thor (>= 0.18.1, < 2.0)
|
84
|
+
rake (10.1.1)
|
85
|
+
rspec (2.14.1)
|
86
|
+
rspec-core (~> 2.14.0)
|
87
|
+
rspec-expectations (~> 2.14.0)
|
88
|
+
rspec-mocks (~> 2.14.0)
|
89
|
+
rspec-core (2.14.7)
|
90
|
+
rspec-expectations (2.14.5)
|
91
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
92
|
+
rspec-mocks (2.14.6)
|
93
|
+
rspec-rails (2.14.1)
|
94
|
+
actionpack (>= 3.0)
|
95
|
+
activemodel (>= 3.0)
|
96
|
+
activesupport (>= 3.0)
|
97
|
+
railties (>= 3.0)
|
98
|
+
rspec-core (~> 2.14.0)
|
99
|
+
rspec-expectations (~> 2.14.0)
|
100
|
+
rspec-mocks (~> 2.14.0)
|
101
|
+
slop (3.4.7)
|
102
|
+
sprockets (2.11.0)
|
103
|
+
hike (~> 1.2)
|
104
|
+
multi_json (~> 1.0)
|
105
|
+
rack (~> 1.0)
|
106
|
+
tilt (~> 1.1, != 1.3.0)
|
107
|
+
sprockets-rails (2.0.1)
|
108
|
+
actionpack (>= 3.0)
|
109
|
+
activesupport (>= 3.0)
|
110
|
+
sprockets (~> 2.8)
|
111
|
+
thor (0.18.1)
|
112
|
+
thread_safe (0.2.0)
|
113
|
+
atomic (>= 1.1.7, < 2)
|
114
|
+
tilt (1.4.1)
|
115
|
+
treetop (1.4.15)
|
116
|
+
polyglot
|
117
|
+
polyglot (>= 0.3.1)
|
118
|
+
tzinfo (0.3.38)
|
119
|
+
warden (1.2.3)
|
120
|
+
rack (>= 1.0)
|
121
|
+
|
122
|
+
PLATFORMS
|
123
|
+
ruby
|
124
|
+
|
125
|
+
DEPENDENCIES
|
126
|
+
active_directory_login!
|
127
|
+
bundler (~> 1.3)
|
128
|
+
datacom-net-ldap
|
129
|
+
datacom_active_directory
|
130
|
+
devise (= 3.0.0)
|
131
|
+
flexmock
|
132
|
+
pry
|
133
|
+
rails (~> 4.0)
|
134
|
+
rake
|
135
|
+
rspec (~> 2.14)
|
136
|
+
rspec-rails (~> 2.14)
|
137
|
+
warden
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_directory_login
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brad Murray
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '4.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '4.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
@@ -70,70 +70,70 @@ dependencies:
|
|
70
70
|
name: warden
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - ~>
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '2.14'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - ~>
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '2.14'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rspec-rails
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - ~>
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '2.14'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - ~>
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '2.14'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: flexmock
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: pry
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
@@ -171,22 +171,17 @@ executables: []
|
|
171
171
|
extensions: []
|
172
172
|
extra_rdoc_files: []
|
173
173
|
files:
|
174
|
-
- .gitignore
|
175
174
|
- Gemfile
|
175
|
+
- Gemfile.lock
|
176
176
|
- LICENSE.txt
|
177
177
|
- README.md
|
178
178
|
- Rakefile
|
179
|
-
- active_directory_login.gemspec
|
180
179
|
- lib/active_directory_login.rb
|
181
180
|
- lib/active_directory_login/client.rb
|
182
181
|
- lib/active_directory_login/group_resource.rb
|
183
182
|
- lib/active_directory_login/health_check.rb
|
184
183
|
- lib/active_directory_login/version.rb
|
185
184
|
- lib/devise/strategies/active_directory_authenticatable.rb
|
186
|
-
- spec/active_directory_login_spec.rb
|
187
|
-
- spec/client_spec.rb
|
188
|
-
- spec/models/user.rb
|
189
|
-
- spec/spec_helper.rb
|
190
185
|
homepage: http://github.com/datacom/active_directory_login
|
191
186
|
licenses:
|
192
187
|
- MIT
|
@@ -197,12 +192,12 @@ require_paths:
|
|
197
192
|
- lib
|
198
193
|
required_ruby_version: !ruby/object:Gem::Requirement
|
199
194
|
requirements:
|
200
|
-
- -
|
195
|
+
- - ">="
|
201
196
|
- !ruby/object:Gem::Version
|
202
197
|
version: '0'
|
203
198
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
204
199
|
requirements:
|
205
|
-
- -
|
200
|
+
- - ">="
|
206
201
|
- !ruby/object:Gem::Version
|
207
202
|
version: '0'
|
208
203
|
requirements: []
|
@@ -211,8 +206,4 @@ rubygems_version: 2.2.2
|
|
211
206
|
signing_key:
|
212
207
|
specification_version: 4
|
213
208
|
summary: Devise based AD User Logins
|
214
|
-
test_files:
|
215
|
-
- spec/active_directory_login_spec.rb
|
216
|
-
- spec/client_spec.rb
|
217
|
-
- spec/models/user.rb
|
218
|
-
- spec/spec_helper.rb
|
209
|
+
test_files: []
|
data/.gitignore
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'active_directory_login/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "active_directory_login"
|
8
|
-
spec.version = ActiveDirectoryLogin::VERSION
|
9
|
-
spec.authors = ["Brad Murray"]
|
10
|
-
spec.email = ["wyaeld@gmail.com"]
|
11
|
-
spec.description = "Devise based AD User Logins"
|
12
|
-
spec.summary = "Devise based AD User Logins"
|
13
|
-
spec.homepage = %q{http://github.com/datacom/active_directory_login}
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files`.split($/)
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
-
spec.add_development_dependency "rake"
|
23
|
-
|
24
|
-
spec.add_development_dependency "rails", "~> 4.0"
|
25
|
-
spec.add_development_dependency "devise", "3.0.0"
|
26
|
-
spec.add_development_dependency "warden"
|
27
|
-
|
28
|
-
spec.add_development_dependency 'rspec', '~> 2.14'
|
29
|
-
spec.add_development_dependency 'rspec-rails', '~> 2.14'
|
30
|
-
spec.add_development_dependency 'flexmock'
|
31
|
-
spec.add_development_dependency 'pry'
|
32
|
-
|
33
|
-
spec.add_dependency "datacom_active_directory", '1.5.6.datacom'
|
34
|
-
spec.add_dependency "datacom-net-ldap", '0.5.0.datacom'
|
35
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'active_directory_login'
|
3
|
-
require 'active_directory_login/group_resource'
|
4
|
-
|
5
|
-
require 'devise/strategies/authenticatable'
|
6
|
-
require 'devise'
|
7
|
-
describe ActiveDirectoryLogin do
|
8
|
-
|
9
|
-
before do
|
10
|
-
ActiveDirectoryLogin.auth_method = 'simple'
|
11
|
-
ActiveDirectoryLogin.username = 'svcdgauth'
|
12
|
-
ActiveDirectoryLogin.password = 'Friday10'
|
13
|
-
ActiveDirectoryLogin.host = 'dnzdc3.datacom.co.nz'
|
14
|
-
ActiveDirectoryLogin.port = '389'
|
15
|
-
ActiveDirectoryLogin.base = 'DC=datacom,DC=co,DC=nz'
|
16
|
-
ActiveDirectoryLogin.staff_dn = 'CN=DocGenie-Staff,OU=Datacom Systems Wellington,OU=Datacom Systems,OU=Groups - Universal Distribution Lists,DC=datacom,DC=co,DC=nz'
|
17
|
-
ActiveDirectoryLogin.superuser_dn = 'CN=DocGenie-SystemOwners,OU=Datacom Systems Wellington,OU=Datacom Systems,OU=Groups - Universal Distribution Lists,DC=datacom,DC=co,DC=nz'
|
18
|
-
ActiveDirectoryLogin.user_dn = 'CN=DocGenie-Users,OU=Datacom Systems Wellington,OU=Datacom Systems,OU=Groups - Universal Distribution Lists,DC=datacom,DC=co,DC=nz'
|
19
|
-
end
|
20
|
-
|
21
|
-
describe '.user' do
|
22
|
-
|
23
|
-
it 'requires a value' do
|
24
|
-
expect { ActiveDirectoryLogin.find_user nil
|
25
|
-
}.to raise_error ActiveDirectoryLogin::NoSearchKey
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'requires a value' do
|
29
|
-
expect { ActiveDirectoryLogin.find_user ''
|
30
|
-
}.to raise_error ActiveDirectoryLogin::NoSearchKey
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'finds Brad by username' do
|
36
|
-
login = 'bradmu'
|
37
|
-
user = ActiveDirectoryLogin.find_user login
|
38
|
-
user[:cn].should == "Brad Murray [DATACOM]"
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'finds Brad by email' do
|
42
|
-
login = 'brad.murray@datacom.co.nz'
|
43
|
-
user = ActiveDirectoryLogin.find_user login
|
44
|
-
user[:cn].should == "Brad Murray [DATACOM]"
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
data/spec/client_spec.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'active_directory_login/client'
|
3
|
-
|
4
|
-
describe ActiveDirectoryLogin::Client do
|
5
|
-
|
6
|
-
def valid_options
|
7
|
-
options = {}
|
8
|
-
options[:auth_method] = 'simple'
|
9
|
-
options[:username] = 'foo'
|
10
|
-
options[:password] = 'bar'
|
11
|
-
options[:host] = 'ldap.example.com'
|
12
|
-
options[:port] = '633'
|
13
|
-
options[:base] = 'DC=example,DC=com'
|
14
|
-
options
|
15
|
-
end
|
16
|
-
|
17
|
-
|
18
|
-
describe 'initialize' do
|
19
|
-
|
20
|
-
subject { ActiveDirectoryLogin::Client.new options}
|
21
|
-
|
22
|
-
describe 'with defaults' do
|
23
|
-
let(:options) { Hash.new }
|
24
|
-
|
25
|
-
its(:host) { should == nil}
|
26
|
-
its(:port) { should == '389'}
|
27
|
-
its(:base) { should == nil}
|
28
|
-
its(:username) { should == nil }
|
29
|
-
its(:password) { should == nil}
|
30
|
-
its(:auth_method) { should == 'anonymous'}
|
31
|
-
end
|
32
|
-
|
33
|
-
describe 'with values' do
|
34
|
-
let(:options) { valid_options }
|
35
|
-
|
36
|
-
its(:host) { should == 'ldap.example.com'}
|
37
|
-
its(:port) { should == '633'}
|
38
|
-
its(:base) { should == 'DC=example,DC=com'}
|
39
|
-
its(:username) { should == 'foo'}
|
40
|
-
its(:password) { should == 'bar'}
|
41
|
-
its(:auth_method) { should == 'simple'}
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
end
|
data/spec/models/user.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# require 'active_model/naming'
|
2
|
-
# require 'active_model/model'
|
3
|
-
require 'active_model'
|
4
|
-
class User
|
5
|
-
include ActiveModel::Model
|
6
|
-
|
7
|
-
# after_initialize :defaults
|
8
|
-
|
9
|
-
# def defaults
|
10
|
-
# binding.pry
|
11
|
-
# end
|
12
|
-
|
13
|
-
# def init(args)
|
14
|
-
# args.each_pair do |k,v|
|
15
|
-
# self[k] = v
|
16
|
-
# end
|
17
|
-
# end
|
18
|
-
|
19
|
-
attr_accessor :name, :email, :staff
|
20
|
-
|
21
|
-
alias_method :staff?, :staff
|
22
|
-
|
23
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require 'bundler/setup'
|
3
|
-
rescue LoadError
|
4
|
-
puts 'although not required, it is recommended that you use bundler when running the tests'
|
5
|
-
end
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
require 'rails'
|
10
|
-
require 'rspec'
|
11
|
-
# require 'rspec/rails'
|
12
|
-
require 'rspec/autorun'
|
13
|
-
# require 'flexmock/rspec/configure'
|
14
|
-
|
15
|
-
require 'pry'
|
16
|
-
|
17
|
-
|
18
|
-
unless Object.const_defined? 'User'
|
19
|
-
# binding.pry
|
20
|
-
require 'models/user'
|
21
|
-
# mock_model 'User'
|
22
|
-
end
|
23
|
-
|
24
|
-
RSpec.configure do |config|
|
25
|
-
|
26
|
-
# co
|
27
|
-
end
|