sorcery 0.7.0 → 0.7.1

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

Potentially problematic release.


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

Files changed (164) hide show
  1. data/Gemfile +2 -1
  2. data/Gemfile.lock +58 -51
  3. data/README.rdoc +19 -57
  4. data/Rakefile +27 -1
  5. data/VERSION +1 -1
  6. data/lib/generators/sorcery/USAGE +22 -0
  7. data/lib/generators/sorcery/install_generator.rb +71 -0
  8. data/lib/{sorcery/initializers → generators/sorcery/templates}/initializer.rb +4 -4
  9. data/lib/generators/sorcery/templates/migration/activity_logging.rb +17 -0
  10. data/lib/generators/sorcery/templates/migration/brute_force_protection.rb +11 -0
  11. data/lib/generators/{sorcery_migration/templates → sorcery/templates/migration}/core.rb +2 -2
  12. data/lib/generators/{sorcery_migration/templates → sorcery/templates/migration}/external.rb +1 -1
  13. data/lib/generators/sorcery/templates/migration/remember_me.rb +15 -0
  14. data/lib/generators/sorcery/templates/migration/reset_password.rb +17 -0
  15. data/lib/generators/sorcery/templates/migration/user_activation.rb +17 -0
  16. data/lib/sorcery.rb +5 -7
  17. data/lib/sorcery/controller.rb +40 -39
  18. data/lib/sorcery/controller/submodules/activity_logging.rb +7 -10
  19. data/lib/sorcery/controller/submodules/external/protocols/oauth2.rb +23 -8
  20. data/lib/sorcery/controller/submodules/remember_me.rb +3 -2
  21. data/lib/sorcery/model.rb +21 -4
  22. data/lib/sorcery/model/adapters/mongo_mapper.rb +49 -0
  23. data/lib/sorcery/model/adapters/mongoid.rb +1 -1
  24. data/lib/sorcery/model/submodules/brute_force_protection.rb +8 -0
  25. data/lib/sorcery/model/submodules/remember_me.rb +8 -1
  26. data/lib/sorcery/model/submodules/reset_password.rb +10 -0
  27. data/lib/sorcery/model/submodules/user_activation.rb +12 -0
  28. data/sorcery.gemspec +86 -210
  29. data/spec/Gemfile +1 -1
  30. data/spec/Gemfile.lock +28 -15
  31. data/spec/README.md +6 -1
  32. data/spec/rails3/Gemfile +2 -2
  33. data/spec/rails3/Gemfile.lock +45 -50
  34. data/spec/rails3/spec/controller_oauth2_spec.rb +5 -3
  35. data/spec/rails3/spec/spec_helper.rb +1 -3
  36. data/spec/rails3_mongo_mapper/.gitignore +4 -0
  37. data/spec/rails3_mongo_mapper/.rspec +1 -0
  38. data/spec/{sinatra_modular → rails3_mongo_mapper}/Gemfile +5 -5
  39. data/spec/rails3_mongo_mapper/Gemfile.lock +159 -0
  40. data/spec/{sinatra → rails3_mongo_mapper}/Rakefile +3 -3
  41. data/spec/rails3_mongo_mapper/app/controllers/application_controller.rb +108 -0
  42. data/spec/rails3_mongo_mapper/app/helpers/application_helper.rb +2 -0
  43. data/spec/{sinatra → rails3_mongo_mapper/app/mailers}/sorcery_mailer.rb +0 -0
  44. data/spec/rails3_mongo_mapper/app/models/authentication.rb +6 -0
  45. data/spec/rails3_mongo_mapper/app/models/user.rb +5 -0
  46. data/spec/rails3_mongo_mapper/app/views/layouts/application.html.erb +14 -0
  47. data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_email.html.erb +17 -0
  48. data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_email.text.erb +9 -0
  49. data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_success_email.html.erb +17 -0
  50. data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_success_email.text.erb +9 -0
  51. data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/reset_password_email.html.erb +16 -0
  52. data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/reset_password_email.text.erb +8 -0
  53. data/spec/rails3_mongo_mapper/config.ru +4 -0
  54. data/spec/rails3_mongo_mapper/config/application.rb +51 -0
  55. data/spec/rails3_mongo_mapper/config/boot.rb +13 -0
  56. data/spec/rails3_mongo_mapper/config/environment.rb +5 -0
  57. data/spec/rails3_mongo_mapper/config/environments/development.rb +30 -0
  58. data/spec/rails3_mongo_mapper/config/environments/in_memory.rb +0 -0
  59. data/spec/rails3_mongo_mapper/config/environments/production.rb +49 -0
  60. data/spec/rails3_mongo_mapper/config/environments/test.rb +35 -0
  61. data/spec/rails3_mongo_mapper/config/initializers/backtrace_silencers.rb +7 -0
  62. data/spec/rails3_mongo_mapper/config/initializers/inflections.rb +10 -0
  63. data/spec/rails3_mongo_mapper/config/initializers/mime_types.rb +5 -0
  64. data/spec/rails3_mongo_mapper/config/initializers/mongo.rb +2 -0
  65. data/spec/rails3_mongo_mapper/config/initializers/secret_token.rb +7 -0
  66. data/spec/rails3_mongo_mapper/config/initializers/session_store.rb +8 -0
  67. data/spec/rails3_mongo_mapper/config/locales/en.yml +5 -0
  68. data/spec/rails3_mongo_mapper/config/routes.rb +59 -0
  69. data/spec/rails3_mongo_mapper/db/schema.rb +23 -0
  70. data/spec/rails3_mongo_mapper/db/seeds.rb +7 -0
  71. data/spec/rails3_mongo_mapper/lib/tasks/.gitkeep +0 -0
  72. data/spec/rails3_mongo_mapper/public/404.html +26 -0
  73. data/spec/rails3_mongo_mapper/public/422.html +26 -0
  74. data/spec/rails3_mongo_mapper/public/500.html +26 -0
  75. data/spec/rails3_mongo_mapper/public/favicon.ico +0 -0
  76. data/spec/rails3_mongo_mapper/public/images/rails.png +0 -0
  77. data/spec/rails3_mongo_mapper/public/javascripts/application.js +2 -0
  78. data/spec/rails3_mongo_mapper/public/javascripts/controls.js +965 -0
  79. data/spec/rails3_mongo_mapper/public/javascripts/dragdrop.js +974 -0
  80. data/spec/rails3_mongo_mapper/public/javascripts/effects.js +1123 -0
  81. data/spec/rails3_mongo_mapper/public/javascripts/prototype.js +6001 -0
  82. data/spec/rails3_mongo_mapper/public/javascripts/rails.js +175 -0
  83. data/spec/rails3_mongo_mapper/public/robots.txt +5 -0
  84. data/spec/rails3_mongo_mapper/public/stylesheets/.gitkeep +0 -0
  85. data/spec/rails3_mongo_mapper/script/rails +6 -0
  86. data/spec/{sinatra → rails3_mongo_mapper}/spec/controller_spec.rb +45 -42
  87. data/spec/{sinatra → rails3_mongo_mapper}/spec/spec.opts +0 -0
  88. data/spec/rails3_mongo_mapper/spec/spec_helper.orig.rb +27 -0
  89. data/spec/rails3_mongo_mapper/spec/spec_helper.rb +55 -0
  90. data/spec/rails3_mongo_mapper/spec/user_activation_spec.rb +9 -0
  91. data/spec/rails3_mongo_mapper/spec/user_activity_logging_spec.rb +8 -0
  92. data/spec/rails3_mongo_mapper/spec/user_brute_force_protection_spec.rb +8 -0
  93. data/spec/rails3_mongo_mapper/spec/user_oauth_spec.rb +8 -0
  94. data/spec/rails3_mongo_mapper/spec/user_remember_me_spec.rb +8 -0
  95. data/spec/rails3_mongo_mapper/spec/user_reset_password_spec.rb +8 -0
  96. data/spec/rails3_mongo_mapper/spec/user_spec.rb +37 -0
  97. data/spec/rails3_mongo_mapper/vendor/plugins/.gitkeep +0 -0
  98. data/spec/rails3_mongoid/Gemfile +1 -1
  99. data/spec/rails3_mongoid/Gemfile.lock +44 -35
  100. data/spec/rails3_mongoid/spec/controller_activity_logging_spec.rb +98 -0
  101. data/spec/rails3_mongoid/spec/user_spec.rb +1 -0
  102. data/spec/shared_examples/user_shared_examples.rb +29 -1
  103. metadata +124 -237
  104. data/lib/generators/sorcery_migration/sorcery_migration_generator.rb +0 -24
  105. data/lib/generators/sorcery_migration/templates/activity_logging.rb +0 -17
  106. data/lib/generators/sorcery_migration/templates/brute_force_protection.rb +0 -11
  107. data/lib/generators/sorcery_migration/templates/remember_me.rb +0 -15
  108. data/lib/generators/sorcery_migration/templates/reset_password.rb +0 -17
  109. data/lib/generators/sorcery_migration/templates/user_activation.rb +0 -17
  110. data/lib/sorcery/controller/adapters/sinatra.rb +0 -115
  111. data/lib/sorcery/sinatra.rb +0 -4
  112. data/lib/sorcery/test_helpers/internal/sinatra.rb +0 -74
  113. data/lib/sorcery/test_helpers/internal/sinatra_modular.rb +0 -74
  114. data/lib/sorcery/test_helpers/sinatra.rb +0 -88
  115. data/spec/rails3/Rakefile.unused +0 -7
  116. data/spec/sinatra/Gemfile +0 -15
  117. data/spec/sinatra/Gemfile.lock +0 -115
  118. data/spec/sinatra/authentication.rb +0 -3
  119. data/spec/sinatra/db/migrate/activation/20101224223622_add_activation_to_users.rb +0 -17
  120. data/spec/sinatra/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb +0 -17
  121. data/spec/sinatra/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb +0 -11
  122. data/spec/sinatra/db/migrate/core/20101224223620_create_users.rb +0 -16
  123. data/spec/sinatra/db/migrate/external/20101224223628_create_authentications.rb +0 -14
  124. data/spec/sinatra/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb +0 -15
  125. data/spec/sinatra/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb +0 -13
  126. data/spec/sinatra/filters.rb +0 -27
  127. data/spec/sinatra/modular.rb +0 -157
  128. data/spec/sinatra/myapp.rb +0 -133
  129. data/spec/sinatra/spec/controller_activity_logging_spec.rb +0 -85
  130. data/spec/sinatra/spec/controller_brute_force_protection_spec.rb +0 -70
  131. data/spec/sinatra/spec/controller_http_basic_auth_spec.rb +0 -53
  132. data/spec/sinatra/spec/controller_oauth2_spec.rb +0 -96
  133. data/spec/sinatra/spec/controller_oauth_spec.rb +0 -100
  134. data/spec/sinatra/spec/controller_remember_me_spec.rb +0 -64
  135. data/spec/sinatra/spec/controller_session_timeout_spec.rb +0 -57
  136. data/spec/sinatra/spec/spec_helper.rb +0 -45
  137. data/spec/sinatra/user.rb +0 -6
  138. data/spec/sinatra/views/test_login.erb +0 -4
  139. data/spec/sinatra_modular/Gemfile.lock +0 -115
  140. data/spec/sinatra_modular/Rakefile +0 -11
  141. data/spec/sinatra_modular/authentication.rb +0 -3
  142. data/spec/sinatra_modular/db/migrate/activation/20101224223622_add_activation_to_users.rb +0 -17
  143. data/spec/sinatra_modular/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb +0 -17
  144. data/spec/sinatra_modular/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb +0 -11
  145. data/spec/sinatra_modular/db/migrate/core/20101224223620_create_users.rb +0 -16
  146. data/spec/sinatra_modular/db/migrate/external/20101224223628_create_authentications.rb +0 -14
  147. data/spec/sinatra_modular/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb +0 -15
  148. data/spec/sinatra_modular/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb +0 -13
  149. data/spec/sinatra_modular/filters.rb +0 -27
  150. data/spec/sinatra_modular/modular.rb +0 -157
  151. data/spec/sinatra_modular/myapp.rb +0 -133
  152. data/spec/sinatra_modular/sorcery_mailer.rb +0 -25
  153. data/spec/sinatra_modular/spec_modular/controller_activity_logging_spec.rb +0 -85
  154. data/spec/sinatra_modular/spec_modular/controller_brute_force_protection_spec.rb +0 -70
  155. data/spec/sinatra_modular/spec_modular/controller_http_basic_auth_spec.rb +0 -53
  156. data/spec/sinatra_modular/spec_modular/controller_oauth2_spec.rb +0 -96
  157. data/spec/sinatra_modular/spec_modular/controller_oauth_spec.rb +0 -100
  158. data/spec/sinatra_modular/spec_modular/controller_remember_me_spec.rb +0 -64
  159. data/spec/sinatra_modular/spec_modular/controller_session_timeout_spec.rb +0 -57
  160. data/spec/sinatra_modular/spec_modular/controller_spec.rb +0 -116
  161. data/spec/sinatra_modular/spec_modular/spec.opts +0 -2
  162. data/spec/sinatra_modular/spec_modular/spec_helper.rb +0 -51
  163. data/spec/sinatra_modular/user.rb +0 -6
  164. data/spec/sinatra_modular/views/test_login.erb +0 -4
data/spec/Gemfile CHANGED
@@ -4,7 +4,7 @@ gem "rails", '3.0.3'
4
4
  gem 'bcrypt-ruby', :require => 'bcrypt'
5
5
  gem "sorcery", '>= 0.1.0', :path => '../'
6
6
  gem 'oauth', "~> 0.4.4"
7
- gem 'oauth2', "~> 0.5.1"
7
+ gem 'oauth2', "~> 0.4.1"
8
8
  group :development do
9
9
  gem "rspec", "~> 2.5.0"
10
10
  gem 'ruby-debug19'
data/spec/Gemfile.lock CHANGED
@@ -1,10 +1,13 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- sorcery (0.6.1)
4
+ sorcery (0.7.0)
5
5
  bcrypt-ruby (~> 3.0.0)
6
+ mongo_mapper
6
7
  oauth (~> 0.4.4)
7
- oauth2 (~> 0.5.0)
8
+ oauth (~> 0.4.4)
9
+ oauth2 (~> 0.4.1)
10
+ oauth2 (~> 0.4.1)
8
11
 
9
12
  GEM
10
13
  remote: http://rubygems.org/
@@ -39,16 +42,17 @@ GEM
39
42
  addressable (2.2.6)
40
43
  archive-tar-minitar (0.5.2)
41
44
  arel (2.0.10)
42
- bcrypt-ruby (3.0.0)
45
+ bcrypt-ruby (3.0.1)
46
+ bson (1.4.1)
43
47
  builder (2.1.2)
44
48
  columnize (0.3.4)
45
49
  diff-lcs (1.1.3)
46
50
  erubis (2.6.6)
47
51
  abstract (>= 1.0.0)
48
- faraday (0.7.4)
49
- addressable (~> 2.2.6)
52
+ faraday (0.6.1)
53
+ addressable (~> 2.2.4)
50
54
  multipart-post (~> 1.1.0)
51
- rack (< 2, >= 1.1.0)
55
+ rack (>= 1.1.0, < 2)
52
56
  i18n (0.6.0)
53
57
  linecache19 (0.5.12)
54
58
  ruby_core_source (>= 0.1.4)
@@ -58,14 +62,22 @@ GEM
58
62
  mime-types (~> 1.16)
59
63
  treetop (~> 1.4.8)
60
64
  mime-types (1.16)
65
+ mongo (1.4.1)
66
+ bson (= 1.4.1)
67
+ mongo_mapper (0.9.2)
68
+ activemodel (~> 3.0)
69
+ activesupport (~> 3.0)
70
+ plucky (~> 0.3.8)
61
71
  multi_json (1.0.3)
62
72
  multipart-post (1.1.3)
63
73
  oauth (0.4.5)
64
- oauth2 (0.5.1)
65
- faraday (~> 0.7.4)
66
- multi_json (~> 1.0.3)
74
+ oauth2 (0.4.1)
75
+ faraday (~> 0.6.1)
76
+ multi_json (>= 0.0.5)
77
+ plucky (0.3.8)
78
+ mongo (~> 1.3)
67
79
  polyglot (0.3.2)
68
- rack (1.2.3)
80
+ rack (1.2.4)
69
81
  rack-mount (0.6.14)
70
82
  rack (>= 1.0.0)
71
83
  rack-test (0.5.7)
@@ -102,14 +114,15 @@ GEM
102
114
  ruby-debug-base19 (>= 0.11.19)
103
115
  ruby_core_source (0.1.5)
104
116
  archive-tar-minitar (>= 0.5.2)
105
- simplecov (0.4.2)
106
- simplecov-html (~> 0.4.4)
107
- simplecov-html (0.4.5)
117
+ simplecov (0.5.4)
118
+ multi_json (~> 1.0.3)
119
+ simplecov-html (~> 0.5.3)
120
+ simplecov-html (0.5.3)
108
121
  thor (0.14.6)
109
122
  treetop (1.4.10)
110
123
  polyglot
111
124
  polyglot (>= 0.3.1)
112
- tzinfo (0.3.29)
125
+ tzinfo (0.3.30)
113
126
 
114
127
  PLATFORMS
115
128
  ruby
@@ -117,7 +130,7 @@ PLATFORMS
117
130
  DEPENDENCIES
118
131
  bcrypt-ruby
119
132
  oauth (~> 0.4.4)
120
- oauth2 (~> 0.5.1)
133
+ oauth2 (~> 0.4.1)
121
134
  rails (= 3.0.3)
122
135
  rspec (~> 2.5.0)
123
136
  ruby-debug19
data/spec/README.md CHANGED
@@ -18,9 +18,14 @@ To run framework specs, cd into each directory, bundle, and run the specs. For e
18
18
  bundle install
19
19
  rake spec
20
20
 
21
- **Note:** the rails3_mongoid sample app does require, well, MongoDB. Installing MongoDB on mac osx is easy with homebrew. Seeing as you're reading the readme for running specs, I'll assume you can install MongoDB on your machine. For the purpose of running these tests, I put mongod in verbose mode and in the background so I can see it log to stdout.
21
+ **Note:** the rails3_mongoid and rails3_mongo_mapper sample apps do require, well, MongoDB. Installing MongoDB on mac osx is easy with homebrew. Seeing as you're reading the readme for running specs, I'll assume you can install MongoDB on your machine. For the purpose of running these tests, I put mongod in verbose mode and in the background so I can see it log to stdout.
22
22
 
23
23
  cd spec/rails3_mongoid
24
24
  bundle install
25
25
  mongod -v &
26
+ rake spec
27
+
28
+ cd spec/rails3_mongo_mapper
29
+ bundle install
30
+ mongod -v &
26
31
  rake spec
data/spec/rails3/Gemfile CHANGED
@@ -2,7 +2,7 @@ source 'http://rubygems.org'
2
2
 
3
3
  gem 'rails', '3.0.3'
4
4
  gem 'sqlite3-ruby', :require => 'sqlite3'
5
- gem "sorcery", '>= 0.1.0', :path => '../../../'
5
+ gem "sorcery", '>= 0.1.0', :path => '../../'
6
6
 
7
7
  group :development, :test do
8
8
  gem "rspec", "~> 2.5.0"
@@ -10,6 +10,6 @@ group :development, :test do
10
10
  gem 'ruby-debug19'
11
11
  gem 'simplecov', '>= 0.3.8', :require => false # Will install simplecov-html as a dependency
12
12
  gem 'timecop'
13
- gem 'capybara', '~> 1.1.1'
13
+ # gem 'capybara', '~> 1.1.1'
14
14
  gem 'launchy', '~> 2.0.5'
15
15
  end
@@ -1,10 +1,13 @@
1
1
  PATH
2
- remote: ../../../
2
+ remote: ../../
3
3
  specs:
4
- sorcery (0.6.1)
4
+ sorcery (0.7.0)
5
5
  bcrypt-ruby (~> 3.0.0)
6
+ mongo_mapper
6
7
  oauth (~> 0.4.4)
7
- oauth2 (~> 0.5.0)
8
+ oauth (~> 0.4.4)
9
+ oauth2 (~> 0.4.1)
10
+ oauth2 (~> 0.4.1)
8
11
 
9
12
  GEM
10
13
  remote: http://rubygems.org/
@@ -38,51 +41,48 @@ GEM
38
41
  activesupport (3.0.3)
39
42
  addressable (2.2.6)
40
43
  archive-tar-minitar (0.5.2)
41
- arel (2.0.6)
44
+ arel (2.0.10)
42
45
  bcrypt-ruby (3.0.1)
46
+ bson (1.4.1)
43
47
  builder (2.1.2)
44
- capybara (1.1.1)
45
- mime-types (>= 1.16)
46
- nokogiri (>= 1.3.3)
47
- rack (>= 1.0.0)
48
- rack-test (>= 0.5.4)
49
- selenium-webdriver (~> 2.0)
50
- xpath (~> 0.1.4)
51
- childprocess (0.2.2)
52
- ffi (~> 1.0.6)
53
- columnize (0.3.2)
54
- diff-lcs (1.1.2)
48
+ columnize (0.3.4)
49
+ diff-lcs (1.1.3)
55
50
  erubis (2.6.6)
56
51
  abstract (>= 1.0.0)
57
- faraday (0.7.4)
58
- addressable (~> 2.2.6)
52
+ faraday (0.6.1)
53
+ addressable (~> 2.2.4)
59
54
  multipart-post (~> 1.1.0)
60
- rack (< 2, >= 1.1.0)
61
- ffi (1.0.9)
62
- i18n (0.5.0)
63
- json_pure (1.5.1)
55
+ rack (>= 1.1.0, < 2)
56
+ i18n (0.6.0)
64
57
  launchy (2.0.5)
65
58
  addressable (~> 2.2.6)
66
- linecache19 (0.5.11)
59
+ linecache19 (0.5.12)
67
60
  ruby_core_source (>= 0.1.4)
68
- mail (2.2.13)
61
+ mail (2.2.19)
69
62
  activesupport (>= 2.3.6)
70
63
  i18n (>= 0.4.0)
71
64
  mime-types (~> 1.16)
72
65
  treetop (~> 1.4.8)
73
66
  mime-types (1.16)
67
+ mongo (1.4.1)
68
+ bson (= 1.4.1)
69
+ mongo_mapper (0.9.2)
70
+ activemodel (~> 3.0)
71
+ activesupport (~> 3.0)
72
+ plucky (~> 0.3.8)
74
73
  multi_json (1.0.3)
75
74
  multipart-post (1.1.3)
76
- nokogiri (1.4.4)
77
75
  oauth (0.4.5)
78
- oauth2 (0.5.1)
79
- faraday (~> 0.7.4)
80
- multi_json (~> 1.0.3)
81
- polyglot (0.3.1)
82
- rack (1.2.1)
83
- rack-mount (0.6.13)
76
+ oauth2 (0.4.1)
77
+ faraday (~> 0.6.1)
78
+ multi_json (>= 0.0.5)
79
+ plucky (0.3.8)
80
+ mongo (~> 1.3)
81
+ polyglot (0.3.2)
82
+ rack (1.2.4)
83
+ rack-mount (0.6.14)
84
84
  rack (>= 1.0.0)
85
- rack-test (0.5.6)
85
+ rack-test (0.5.7)
86
86
  rack (>= 1.0)
87
87
  rails (3.0.3)
88
88
  actionmailer (= 3.0.3)
@@ -97,12 +97,12 @@ GEM
97
97
  activesupport (= 3.0.3)
98
98
  rake (>= 0.8.7)
99
99
  thor (~> 0.14.4)
100
- rake (0.8.7)
100
+ rake (0.9.2)
101
101
  rspec (2.5.0)
102
102
  rspec-core (~> 2.5.0)
103
103
  rspec-expectations (~> 2.5.0)
104
104
  rspec-mocks (~> 2.5.0)
105
- rspec-core (2.5.1)
105
+ rspec-core (2.5.2)
106
106
  rspec-expectations (2.5.0)
107
107
  diff-lcs (~> 1.1.2)
108
108
  rspec-mocks (2.5.0)
@@ -111,7 +111,7 @@ GEM
111
111
  activesupport (~> 3.0)
112
112
  railties (~> 3.0)
113
113
  rspec (~> 2.5.0)
114
- ruby-debug-base19 (0.11.24)
114
+ ruby-debug-base19 (0.11.25)
115
115
  columnize (>= 0.3.1)
116
116
  linecache19 (>= 0.5.11)
117
117
  ruby_core_source (>= 0.1.4)
@@ -119,31 +119,26 @@ GEM
119
119
  columnize (>= 0.3.1)
120
120
  linecache19 (>= 0.5.11)
121
121
  ruby-debug-base19 (>= 0.11.19)
122
- ruby_core_source (0.1.4)
122
+ ruby_core_source (0.1.5)
123
123
  archive-tar-minitar (>= 0.5.2)
124
- rubyzip (0.9.4)
125
- selenium-webdriver (2.6.0)
126
- childprocess (>= 0.2.1)
127
- ffi (>= 1.0.7)
128
- json_pure
129
- rubyzip
130
- simplecov (0.3.9)
131
- simplecov-html (>= 0.3.7)
132
- simplecov-html (0.3.9)
133
- sqlite3-ruby (1.3.2)
124
+ simplecov (0.5.4)
125
+ multi_json (~> 1.0.3)
126
+ simplecov-html (~> 0.5.3)
127
+ simplecov-html (0.5.3)
128
+ sqlite3 (1.3.4)
129
+ sqlite3-ruby (1.3.3)
130
+ sqlite3 (>= 1.3.3)
134
131
  thor (0.14.6)
135
132
  timecop (0.3.5)
136
- treetop (1.4.9)
133
+ treetop (1.4.10)
134
+ polyglot
137
135
  polyglot (>= 0.3.1)
138
- tzinfo (0.3.23)
139
- xpath (0.1.4)
140
- nokogiri (~> 1.3)
136
+ tzinfo (0.3.30)
141
137
 
142
138
  PLATFORMS
143
139
  ruby
144
140
 
145
141
  DEPENDENCIES
146
- capybara (~> 1.1.1)
147
142
  launchy (~> 2.0.5)
148
143
  rails (= 3.0.3)
149
144
  rspec (~> 2.5.0)
@@ -5,7 +5,9 @@ def stub_all_oauth2_requests!
5
5
  @client = OAuth2::Client.new("key","secret", :site => "http://myapi.com")
6
6
  OAuth2::Client.stub!(:new).and_return(@client)
7
7
  @acc_token = OAuth2::AccessToken.new(@client, "asd", {})
8
- @client.stub!(:get_token).and_return(@acc_token)
8
+ @webby = @client.web_server
9
+ OAuth2::Strategy::WebServer.stub!(:new).and_return(@webby)
10
+ @webby.stub!(:get_access_token).and_return(@acc_token)
9
11
  @acc_token.stub!(:get).and_return({"id"=>"123", "name"=>"Noam Ben Ari", "first_name"=>"Noam", "last_name"=>"Ben Ari", "link"=>"http://www.facebook.com/nbenari1", "hometown"=>{"id"=>"110619208966868", "name"=>"Haifa, Israel"}, "location"=>{"id"=>"106906559341067", "name"=>"Pardes Hanah, Hefa, Israel"}, "bio"=>"I'm a new daddy, and enjoying it!", "gender"=>"male", "email"=>"nbenari@gmail.com", "timezone"=>2, "locale"=>"en_US", "languages"=>[{"id"=>"108405449189952", "name"=>"Hebrew"}, {"id"=>"106059522759137", "name"=>"English"}, {"id"=>"112624162082677", "name"=>"Russian"}], "verified"=>true, "updated_time"=>"2011-02-16T20:59:38+0000"}.to_json)
10
12
  end
11
13
 
@@ -41,7 +43,7 @@ describe ApplicationController do
41
43
  create_new_user
42
44
  get :login_at_test2
43
45
  response.should be_a_redirect
44
- response.should redirect_to("http://myapi.com/oauth/authorize?redirect_uri=http%3A%2F%2Fblabla.com&scope=email%2Coffline_access")
46
+ response.should redirect_to("http://myapi.com/oauth/authorize?client_id=key&redirect_uri=http%3A%2F%2Fblabla.com&scope=email%2Coffline_access&response_type=code")
45
47
  end
46
48
 
47
49
  it "'login_from' logins if user exists" do
@@ -63,7 +65,7 @@ describe ApplicationController do
63
65
  create_new_user
64
66
  get :login_at_test3
65
67
  response.should be_a_redirect
66
- response.should redirect_to("http://myapi.com/oauth/authorize?redirect_uri=http%3A%2F%2Fblabla.com&scope=")
68
+ response.should redirect_to("http://myapi.com/oauth/authorize?client_id=key&redirect_uri=http%3A%2F%2Fblabla.com&scope=&response_type=code")
67
69
  end
68
70
 
69
71
  it "'login_from' logins if user exists (github)" do
@@ -5,7 +5,7 @@ $: << File.join(File.dirname(__FILE__), '..', '..', 'lib' )
5
5
  ENV["RAILS_ENV"] ||= 'in_memory'
6
6
  require File.expand_path("../../config/environment", __FILE__)
7
7
  require 'rspec/rails'
8
- require 'capybara/rspec'
8
+ #require 'capybara/rspec'
9
9
  require 'timecop'
10
10
  # require 'simplecov'
11
11
  # SimpleCov.root File.join(File.dirname(__FILE__), "..", "..", "rails3" )
@@ -24,8 +24,6 @@ require 'timecop'
24
24
  # in spec/support/ and its subdirectories.
25
25
  Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
26
26
 
27
-
28
-
29
27
  RSpec.configure do |config|
30
28
  config.include RSpec::Rails::ControllerExampleGroup, :example_group => { :file_path => /controller(.)*_spec.rb$/ }
31
29
  # == Mock Framework
@@ -0,0 +1,4 @@
1
+ .bundle
2
+ db/*.sqlite3
3
+ log/*.log
4
+ tmp/**/*
@@ -0,0 +1 @@
1
+ --colour
@@ -1,15 +1,15 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'sinatra', '>= 1.2.0'
4
- gem 'sqlite3-ruby', :require => 'sqlite3'
5
- gem 'activerecord', '>= 3.0.3'
6
- gem 'actionmailer', '>= 3.0.3'
3
+ gem 'rails', '3.0.3'
7
4
  gem "sorcery", '>= 0.1.0', :path => '../../'
5
+ gem "mongo_mapper"
6
+ gem "bson_ext", "~> 1.3"
8
7
 
9
8
  group :development, :test do
10
- gem "rake"
11
9
  gem "rspec", "~> 2.5.0"
10
+ gem 'rspec-rails', "~> 2.5.0"
12
11
  gem 'ruby-debug19'
13
12
  gem 'simplecov', '>= 0.3.8', :require => false # Will install simplecov-html as a dependency
14
13
  gem 'timecop'
14
+ gem 'pry'
15
15
  end
@@ -0,0 +1,159 @@
1
+ PATH
2
+ remote: ../../
3
+ specs:
4
+ sorcery (0.7.0)
5
+ bcrypt-ruby (~> 3.0.0)
6
+ mongo_mapper
7
+ oauth (~> 0.4.4)
8
+ oauth (~> 0.4.4)
9
+ oauth2 (~> 0.4.1)
10
+ oauth2 (~> 0.4.1)
11
+
12
+ GEM
13
+ remote: http://rubygems.org/
14
+ specs:
15
+ abstract (1.0.0)
16
+ actionmailer (3.0.3)
17
+ actionpack (= 3.0.3)
18
+ mail (~> 2.2.9)
19
+ actionpack (3.0.3)
20
+ activemodel (= 3.0.3)
21
+ activesupport (= 3.0.3)
22
+ builder (~> 2.1.2)
23
+ erubis (~> 2.6.6)
24
+ i18n (~> 0.4)
25
+ rack (~> 1.2.1)
26
+ rack-mount (~> 0.6.13)
27
+ rack-test (~> 0.5.6)
28
+ tzinfo (~> 0.3.23)
29
+ activemodel (3.0.3)
30
+ activesupport (= 3.0.3)
31
+ builder (~> 2.1.2)
32
+ i18n (~> 0.4)
33
+ activerecord (3.0.3)
34
+ activemodel (= 3.0.3)
35
+ activesupport (= 3.0.3)
36
+ arel (~> 2.0.2)
37
+ tzinfo (~> 0.3.23)
38
+ activeresource (3.0.3)
39
+ activemodel (= 3.0.3)
40
+ activesupport (= 3.0.3)
41
+ activesupport (3.0.3)
42
+ addressable (2.2.6)
43
+ archive-tar-minitar (0.5.2)
44
+ arel (2.0.10)
45
+ bcrypt-ruby (3.0.1)
46
+ bson (1.4.1)
47
+ bson_ext (1.4.1)
48
+ builder (2.1.2)
49
+ coderay (0.9.8)
50
+ columnize (0.3.4)
51
+ diff-lcs (1.1.3)
52
+ erubis (2.6.6)
53
+ abstract (>= 1.0.0)
54
+ faraday (0.6.1)
55
+ addressable (~> 2.2.4)
56
+ multipart-post (~> 1.1.0)
57
+ rack (>= 1.1.0, < 2)
58
+ i18n (0.6.0)
59
+ linecache19 (0.5.12)
60
+ ruby_core_source (>= 0.1.4)
61
+ mail (2.2.19)
62
+ activesupport (>= 2.3.6)
63
+ i18n (>= 0.4.0)
64
+ mime-types (~> 1.16)
65
+ treetop (~> 1.4.8)
66
+ method_source (0.6.6)
67
+ ruby_parser (~> 2.0.5)
68
+ mime-types (1.16)
69
+ mongo (1.4.1)
70
+ bson (= 1.4.1)
71
+ mongo_mapper (0.9.2)
72
+ activemodel (~> 3.0)
73
+ activesupport (~> 3.0)
74
+ plucky (~> 0.3.8)
75
+ multi_json (1.0.3)
76
+ multipart-post (1.1.3)
77
+ oauth (0.4.5)
78
+ oauth2 (0.4.1)
79
+ faraday (~> 0.6.1)
80
+ multi_json (>= 0.0.5)
81
+ plucky (0.3.8)
82
+ mongo (~> 1.3)
83
+ polyglot (0.3.2)
84
+ pry (0.9.6.2)
85
+ coderay (~> 0.9.8)
86
+ method_source (~> 0.6.5)
87
+ ruby_parser (~> 2.0.5)
88
+ slop (~> 2.1.0)
89
+ rack (1.2.4)
90
+ rack-mount (0.6.14)
91
+ rack (>= 1.0.0)
92
+ rack-test (0.5.7)
93
+ rack (>= 1.0)
94
+ rails (3.0.3)
95
+ actionmailer (= 3.0.3)
96
+ actionpack (= 3.0.3)
97
+ activerecord (= 3.0.3)
98
+ activeresource (= 3.0.3)
99
+ activesupport (= 3.0.3)
100
+ bundler (~> 1.0)
101
+ railties (= 3.0.3)
102
+ railties (3.0.3)
103
+ actionpack (= 3.0.3)
104
+ activesupport (= 3.0.3)
105
+ rake (>= 0.8.7)
106
+ thor (~> 0.14.4)
107
+ rake (0.9.2)
108
+ rspec (2.5.0)
109
+ rspec-core (~> 2.5.0)
110
+ rspec-expectations (~> 2.5.0)
111
+ rspec-mocks (~> 2.5.0)
112
+ rspec-core (2.5.2)
113
+ rspec-expectations (2.5.0)
114
+ diff-lcs (~> 1.1.2)
115
+ rspec-mocks (2.5.0)
116
+ rspec-rails (2.5.0)
117
+ actionpack (~> 3.0)
118
+ activesupport (~> 3.0)
119
+ railties (~> 3.0)
120
+ rspec (~> 2.5.0)
121
+ ruby-debug-base19 (0.11.25)
122
+ columnize (>= 0.3.1)
123
+ linecache19 (>= 0.5.11)
124
+ ruby_core_source (>= 0.1.4)
125
+ ruby-debug19 (0.11.6)
126
+ columnize (>= 0.3.1)
127
+ linecache19 (>= 0.5.11)
128
+ ruby-debug-base19 (>= 0.11.19)
129
+ ruby_core_source (0.1.5)
130
+ archive-tar-minitar (>= 0.5.2)
131
+ ruby_parser (2.0.6)
132
+ sexp_processor (~> 3.0)
133
+ sexp_processor (3.0.7)
134
+ simplecov (0.5.4)
135
+ multi_json (~> 1.0.3)
136
+ simplecov-html (~> 0.5.3)
137
+ simplecov-html (0.5.3)
138
+ slop (2.1.0)
139
+ thor (0.14.6)
140
+ timecop (0.3.5)
141
+ treetop (1.4.10)
142
+ polyglot
143
+ polyglot (>= 0.3.1)
144
+ tzinfo (0.3.30)
145
+
146
+ PLATFORMS
147
+ ruby
148
+
149
+ DEPENDENCIES
150
+ bson_ext (~> 1.3)
151
+ mongo_mapper
152
+ pry
153
+ rails (= 3.0.3)
154
+ rspec (~> 2.5.0)
155
+ rspec-rails (~> 2.5.0)
156
+ ruby-debug19
157
+ simplecov (>= 0.3.8)
158
+ sorcery (>= 0.1.0)!
159
+ timecop