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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 305b65f0af474c793bf5ed8456ba074dfd8a1dd3
4
- data.tar.gz: d0551fded91a57aa7118da7a91fb37faf31d7113
3
+ metadata.gz: dd8e43cb120a2a637a7f5c1ef4c8a9493862f392
4
+ data.tar.gz: 4b28e750c77845d118cd55d232fe958ba512f1d9
5
5
  SHA512:
6
- metadata.gz: 26acf3d25dda874723ed27c40c7bd08a01947898860149b56a7b9fcaa7cbc27d28d8e022fc5c94d7fb2ba0bfc92fd21a12034f44e285f5ed4cce06f276644cca
7
- data.tar.gz: 451d6fa95a5dd7cc1958a3cefc0c84577183464b2816d18f41f901d37dc18e7941b103dbd00b27541f6d6a2619b0830d0f06410534377d40b335e340327873d5
6
+ metadata.gz: bf57109442d5e6f1da392ad1a00c14b42fed17c9121e66d9cc1d682793bd1b3e93ca75a2892473423f3bc10ab88c83db2bcfe0a9e3afea1dffb0bde7671ff104
7
+ data.tar.gz: ac7918ab09b51b0e477a854191003282e964c2aed057125ea9ae096ad327c1911b9820fac2755a2eb1d27259772bef176353fb39137146c070edbb4e37d2bf82
@@ -19,7 +19,7 @@ module RestPack::User::Service::Commands::User
19
19
  user = RestPack::User::Service::Models::User.authenticate(
20
20
  user_id,
21
21
  application_id,
22
- omniauth_response
22
+ raw_inputs[:omniauth_response]
23
23
  )
24
24
 
25
25
  if user
@@ -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
@@ -0,0 +1,7 @@
1
+ module RestPack::User::Service
2
+ class Tasks
3
+ def self.load_tasks
4
+ load "restpack_user_service/tasks/db.rake"
5
+ end
6
+ end
7
+ end
@@ -1,7 +1,7 @@
1
1
  module RestPack
2
2
  module User
3
3
  module Service
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
6
6
  end
7
7
  end
@@ -10,6 +10,8 @@ require "restpack_user_service/configuration"
10
10
  require_rel "restpack_user_service/models"
11
11
  require_rel "restpack_user_service/serializers"
12
12
 
13
+ require "restpack_user_service/tasks"
14
+
13
15
  module RestPack::User::Service::Commands
14
16
 
15
17
  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.2
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-15 00:00:00.000000000 Z
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