token_action 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +1 -1
  3. data/README.md +11 -18
  4. data/Rakefile +13 -4
  5. data/app/controllers/token_action/tokens_controller.rb +19 -11
  6. data/config/routes.rb +1 -1
  7. data/lib/generators/active_record/templates/migration.rb +1 -1
  8. data/lib/generators/templates/README +1 -1
  9. data/lib/token_action.rb +2 -2
  10. data/lib/token_action/{mixins → concerns}/model.rb +0 -0
  11. data/lib/token_action/{mixins → concerns}/token_generator.rb +0 -0
  12. data/lib/token_action/orm/mongoid.rb +6 -6
  13. data/lib/token_action/version.rb +1 -1
  14. data/spec/controllers/token_action/tokens_controller_spec.rb +159 -157
  15. data/spec/dummy/Rakefile +1 -2
  16. data/spec/dummy/app/assets/javascripts/application.js +4 -4
  17. data/spec/dummy/app/assets/stylesheets/application.css +6 -4
  18. data/spec/dummy/app/controllers/application_controller.rb +3 -1
  19. data/spec/dummy/app/controllers/hello_controller.rb +6 -6
  20. data/spec/dummy/app/mongoid/cat.rb +1 -1
  21. data/spec/dummy/app/views/layouts/application.html.erb +2 -2
  22. data/spec/dummy/bin/bundle +3 -0
  23. data/spec/dummy/bin/rails +4 -0
  24. data/spec/dummy/bin/rake +4 -0
  25. data/spec/dummy/bin/setup +29 -0
  26. data/spec/dummy/config.ru +2 -2
  27. data/spec/dummy/config/application.rb +11 -42
  28. data/spec/dummy/config/boot.rb +4 -9
  29. data/spec/dummy/config/database.yml +14 -7
  30. data/spec/dummy/config/environment.rb +3 -3
  31. data/spec/dummy/config/environments/development.rb +22 -18
  32. data/spec/dummy/config/environments/production.rb +46 -34
  33. data/spec/dummy/config/environments/test.rb +18 -17
  34. data/spec/dummy/config/initializers/assets.rb +11 -0
  35. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  36. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  37. data/spec/dummy/config/initializers/session_store.rb +1 -6
  38. data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
  39. data/spec/dummy/config/locales/en.yml +20 -2
  40. data/spec/dummy/config/mongoid.yml +4 -60
  41. data/spec/dummy/config/routes.rb +6 -6
  42. data/spec/dummy/config/secrets.yml +22 -0
  43. data/spec/dummy/db/migrate/20130104151630_create_token_action_tokens.rb +1 -1
  44. data/spec/dummy/db/schema.rb +32 -0
  45. data/spec/dummy/{db/development.sqlite3 → log/.keep} +0 -0
  46. data/spec/dummy/public/404.html +54 -13
  47. data/spec/dummy/public/422.html +54 -13
  48. data/spec/dummy/public/500.html +53 -12
  49. data/spec/factories.rb +1 -1
  50. data/spec/rails_helper.rb +102 -0
  51. data/spec/routing/token_action/tokens_routing_spec.rb +23 -23
  52. data/spec/spec_helper.rb +85 -87
  53. data/spec/token_action/concerns/model_spec.rb +14 -0
  54. data/spec/token_action/concerns/token_generator_spec.rb +13 -0
  55. data/spec/token_action/orm/active_record_spec.rb +4 -2
  56. data/spec/token_action/orm/mongoid_spec.rb +4 -2
  57. data/spec/token_action_spec.rb +9 -9
  58. metadata +109 -158
  59. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  60. data/spec/dummy/log/development.log +0 -16
  61. data/spec/dummy/log/test.log +0 -4739
  62. data/spec/dummy/script/rails +0 -6
  63. data/spec/token_action/mixins/model_spec.rb +0 -13
  64. data/spec/token_action/mixins/token_generator_spec.rb +0 -11
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
-
4
- APP_PATH = File.expand_path('../../config/application', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
6
- require 'rails/commands'
@@ -1,13 +0,0 @@
1
- require 'spec_helper'
2
-
3
- # @todo
4
- describe TokenAction::Token do
5
- it {should validate_presence_of :kind}
6
- it {should validate_uniqueness_of :token}
7
-
8
- describe '#create' do
9
- it 'should set the token' do
10
- FactoryGirl.create(:token).token.should_not be_nil
11
- end
12
- end
13
- end
@@ -1,11 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe TokenAction::TokenGenerator do
4
- describe '.included' do
5
- describe '#generate_token' do
6
- it 'should return a random alphanumeric string' do
7
- Cat.generate_token(:token).should match(/\A[A-Za-z0-9]{20}\z/)
8
- end
9
- end
10
- end
11
- end