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.
- checksums.yaml +7 -0
- data/LICENSE +1 -1
- data/README.md +11 -18
- data/Rakefile +13 -4
- data/app/controllers/token_action/tokens_controller.rb +19 -11
- data/config/routes.rb +1 -1
- data/lib/generators/active_record/templates/migration.rb +1 -1
- data/lib/generators/templates/README +1 -1
- data/lib/token_action.rb +2 -2
- data/lib/token_action/{mixins → concerns}/model.rb +0 -0
- data/lib/token_action/{mixins → concerns}/token_generator.rb +0 -0
- data/lib/token_action/orm/mongoid.rb +6 -6
- data/lib/token_action/version.rb +1 -1
- data/spec/controllers/token_action/tokens_controller_spec.rb +159 -157
- data/spec/dummy/Rakefile +1 -2
- data/spec/dummy/app/assets/javascripts/application.js +4 -4
- data/spec/dummy/app/assets/stylesheets/application.css +6 -4
- data/spec/dummy/app/controllers/application_controller.rb +3 -1
- data/spec/dummy/app/controllers/hello_controller.rb +6 -6
- data/spec/dummy/app/mongoid/cat.rb +1 -1
- data/spec/dummy/app/views/layouts/application.html.erb +2 -2
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +2 -2
- data/spec/dummy/config/application.rb +11 -42
- data/spec/dummy/config/boot.rb +4 -9
- data/spec/dummy/config/database.yml +14 -7
- data/spec/dummy/config/environment.rb +3 -3
- data/spec/dummy/config/environments/development.rb +22 -18
- data/spec/dummy/config/environments/production.rb +46 -34
- data/spec/dummy/config/environments/test.rb +18 -17
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +1 -6
- data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
- data/spec/dummy/config/locales/en.yml +20 -2
- data/spec/dummy/config/mongoid.yml +4 -60
- data/spec/dummy/config/routes.rb +6 -6
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/migrate/20130104151630_create_token_action_tokens.rb +1 -1
- data/spec/dummy/db/schema.rb +32 -0
- data/spec/dummy/{db/development.sqlite3 → log/.keep} +0 -0
- data/spec/dummy/public/404.html +54 -13
- data/spec/dummy/public/422.html +54 -13
- data/spec/dummy/public/500.html +53 -12
- data/spec/factories.rb +1 -1
- data/spec/rails_helper.rb +102 -0
- data/spec/routing/token_action/tokens_routing_spec.rb +23 -23
- data/spec/spec_helper.rb +85 -87
- data/spec/token_action/concerns/model_spec.rb +14 -0
- data/spec/token_action/concerns/token_generator_spec.rb +13 -0
- data/spec/token_action/orm/active_record_spec.rb +4 -2
- data/spec/token_action/orm/mongoid_spec.rb +4 -2
- data/spec/token_action_spec.rb +9 -9
- metadata +109 -158
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy/log/development.log +0 -16
- data/spec/dummy/log/test.log +0 -4739
- data/spec/dummy/script/rails +0 -6
- data/spec/token_action/mixins/model_spec.rb +0 -13
- data/spec/token_action/mixins/token_generator_spec.rb +0 -11
data/spec/dummy/script/rails
DELETED
@@ -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
|