restpack_user_service 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/lib/restpack_user_service/commands/user/omni_authenticate.rb +1 -1
- data/lib/restpack_user_service/tasks/db.rake +39 -0
- data/lib/restpack_user_service/tasks.rb +7 -0
- data/lib/restpack_user_service/version.rb +1 -1
- data/lib/restpack_user_service.rb +2 -0
- data/spec/commands/user/omni_authenticate_spec.rb +8 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd8e43cb120a2a637a7f5c1ef4c8a9493862f392
|
4
|
+
data.tar.gz: 4b28e750c77845d118cd55d232fe958ba512f1d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf57109442d5e6f1da392ad1a00c14b42fed17c9121e66d9cc1d682793bd1b3e93ca75a2892473423f3bc10ab88c83db2bcfe0a9e3afea1dffb0bde7671ff104
|
7
|
+
data.tar.gz: ac7918ab09b51b0e477a854191003282e964c2aed057125ea9ae096ad327c1911b9820fac2755a2eb1d27259772bef176353fb39137146c070edbb4e37d2bf82
|
@@ -0,0 +1,39 @@
|
|
1
|
+
namespace :restpack do
|
2
|
+
desc "Run any outstanding RestPack migrations"
|
3
|
+
task :migrate do
|
4
|
+
Rake::Task["restpack:user:migrate"].invoke
|
5
|
+
end
|
6
|
+
|
7
|
+
desc "List RestPack configuration"
|
8
|
+
task :configuration do
|
9
|
+
Rake::Task["restpack:user:configuration"].invoke
|
10
|
+
end
|
11
|
+
|
12
|
+
namespace :user do
|
13
|
+
desc "Run any outstanding RestPack::Core migrations"
|
14
|
+
task :migrate => ["connection"] do
|
15
|
+
source_migrations_path = File.dirname(__FILE__) + "/../../../db/migrate"
|
16
|
+
target_migrations_path = "db/migrate"
|
17
|
+
|
18
|
+
ActiveRecord::Migration.verbose = true
|
19
|
+
ActiveRecord::Migrator.migrate(source_migrations_path)
|
20
|
+
|
21
|
+
if File.directory?(target_migrations_path)
|
22
|
+
FileUtils.cp_r(Dir["#{source_migrations_path}/*"], target_migrations_path)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
task :connection do
|
27
|
+
config = YAML.load(IO.read('config/database.yml'))
|
28
|
+
environment = ENV['RAILS_ENV'] || ENV['DB'] || 'development'
|
29
|
+
ActiveRecord::Base.establish_connection config[environment]
|
30
|
+
end
|
31
|
+
|
32
|
+
desc "List RestPack::User::Service configuration"
|
33
|
+
task :configuration do
|
34
|
+
p "RestPack::User::Service Configuration"
|
35
|
+
p "--------------------------------"
|
36
|
+
p "TODO"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -45,18 +45,24 @@ describe RestPack::User::Service::Commands::User::OmniAuthenticate do
|
|
45
45
|
context 'new user' do
|
46
46
|
let(:params) {
|
47
47
|
@authentication.omniauth['uid'] += '_new'
|
48
|
-
{
|
48
|
+
return {
|
49
49
|
application_id: @authentication.application_id,
|
50
50
|
omniauth_response: @authentication.omniauth
|
51
|
-
|
51
|
+
}
|
52
|
+
}
|
52
53
|
|
53
54
|
context 'new authentication' do
|
54
55
|
it 'created a new user and authentication' do
|
55
56
|
@existing_user_count = User.count
|
56
57
|
@existing_auth_count = Authentication.count
|
58
|
+
|
57
59
|
response.success?.should == true
|
60
|
+
|
58
61
|
User.count.should == @existing_user_count + 1
|
59
62
|
Authentication.count.should == @existing_auth_count + 1
|
63
|
+
|
64
|
+
new_user = response.result[:users].first
|
65
|
+
new_user[:email].should == @authentication.omniauth['info']['email']
|
60
66
|
end
|
61
67
|
end
|
62
68
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restpack_user_service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gavin Joyce
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: restpack_service
|
@@ -216,6 +216,8 @@ files:
|
|
216
216
|
- lib/restpack_user_service/models/authentication.rb
|
217
217
|
- lib/restpack_user_service/models/user.rb
|
218
218
|
- lib/restpack_user_service/serializers/user_serializer.rb
|
219
|
+
- lib/restpack_user_service/tasks.rb
|
220
|
+
- lib/restpack_user_service/tasks/db.rake
|
219
221
|
- lib/restpack_user_service/version.rb
|
220
222
|
- restpack_user_service.gemspec
|
221
223
|
- spec/commands/user/get_spec.rb
|