cadenero 0.0.1 → 0.0.2.a
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.
- data/MIT-LICENSE +2 -2
- data/README.md +3 -0
- data/app/models/cadenero/v1/account.rb +1 -1
- data/db/migrate/20130612061604_create_cadenero_v1_accounts.rb +2 -0
- data/db/seeds.rb +2 -0
- data/lib/cadenero/version.rb +2 -2
- data/lib/generators/cadenero/install/templates/initializer.rb +16 -0
- data/lib/generators/cadenero/install_generator.rb +143 -0
- data/spec/controllers/cadenero/v1/accounts_controller_spec.rb +25 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +2 -0
- data/spec/dummy/config/application.rb +63 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +14 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +39 -0
- data/spec/dummy/config/environments/production.rb +69 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/cadenero.rb +0 -0
- data/spec/dummy/config/initializers/secret_token.rb +19 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +13 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/schema.rb +45 -0
- data/spec/dummy/log/development.log +94 -0
- data/spec/dummy/log/test.log +8934 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/spec/spec_helper.rb +38 -0
- data/spec/dummy/tmp/ember-rails/ember-data.js +8886 -0
- data/spec/dummy/tmp/ember-rails/ember.js +29953 -0
- data/spec/features/accounts/sign_up_spec.rb +32 -0
- data/spec/features/cadenero/account_spec.rb +24 -0
- data/spec/features/users/sign_in_spec.rb +63 -0
- data/spec/features/users/sign_up_spec.rb +26 -0
- data/spec/generators/install_generator_spec.rb +56 -0
- data/spec/models/cadenero/account_spec.rb +7 -0
- data/spec/models/cadenero/member_spec.rb +7 -0
- data/spec/models/cadenero/user_spec.rb +7 -0
- data/spec/spec_helper.rb +77 -0
- data/spec/support/factories/account_factory.rb +15 -0
- data/spec/support/factories/user_factory.rb +6 -0
- data/spec/support/generator_macros.rb +29 -0
- data/spec/support/subdomain_helpers.rb +8 -0
- metadata +93 -9
- data/db/migrate/20130612093908_add_authentication_token_to_accounts.rb +0 -6
@@ -0,0 +1,69 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# Code is not reloaded between requests
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
config.ember.variant = :production
|
8
|
+
|
9
|
+
# Full error reports are disabled and caching is turned on
|
10
|
+
config.consider_all_requests_local = false
|
11
|
+
config.action_controller.perform_caching = true
|
12
|
+
|
13
|
+
# Disable Rails's static asset server (Apache or nginx will already do this)
|
14
|
+
config.serve_static_assets = false
|
15
|
+
|
16
|
+
# Compress JavaScripts and CSS
|
17
|
+
config.assets.compress = true
|
18
|
+
|
19
|
+
# Don't fallback to assets pipeline if a precompiled asset is missed
|
20
|
+
config.assets.compile = false
|
21
|
+
|
22
|
+
# Generate digests for assets URLs
|
23
|
+
config.assets.digest = true
|
24
|
+
|
25
|
+
# Defaults to nil and saved in location specified by config.assets.prefix
|
26
|
+
# config.assets.manifest = YOUR_PATH
|
27
|
+
|
28
|
+
# Specifies the header that your server uses for sending files
|
29
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
30
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
31
|
+
|
32
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
33
|
+
# config.force_ssl = true
|
34
|
+
|
35
|
+
# See everything in the log (default is :info)
|
36
|
+
# config.log_level = :debug
|
37
|
+
|
38
|
+
# Prepend all log lines with the following tags
|
39
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
40
|
+
|
41
|
+
# Use a different logger for distributed setups
|
42
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
43
|
+
|
44
|
+
# Use a different cache store in production
|
45
|
+
# config.cache_store = :mem_cache_store
|
46
|
+
|
47
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
48
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
49
|
+
|
50
|
+
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
51
|
+
# config.assets.precompile += %w( search.js )
|
52
|
+
|
53
|
+
# Disable delivery errors, bad email addresses will be ignored
|
54
|
+
# config.action_mailer.raise_delivery_errors = false
|
55
|
+
|
56
|
+
# Enable threaded mode
|
57
|
+
# config.threadsafe!
|
58
|
+
|
59
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
60
|
+
# the I18n.default_locale when a translation can not be found)
|
61
|
+
config.i18n.fallbacks = true
|
62
|
+
|
63
|
+
# Send deprecation notices to registered listeners
|
64
|
+
config.active_support.deprecation = :notify
|
65
|
+
|
66
|
+
# Log the query plan for queries taking more than this (works
|
67
|
+
# with SQLite, MySQL, and PostgreSQL)
|
68
|
+
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
69
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
config.ember.variant = :development
|
11
|
+
|
12
|
+
# Configure static asset server for tests with Cache-Control for performance
|
13
|
+
config.serve_static_assets = true
|
14
|
+
config.static_cache_control = "public, max-age=3600"
|
15
|
+
|
16
|
+
# Log error messages when you accidentally call methods on nil
|
17
|
+
config.whiny_nils = true
|
18
|
+
|
19
|
+
# Show full error reports and disable caching
|
20
|
+
config.consider_all_requests_local = true
|
21
|
+
config.action_controller.perform_caching = false
|
22
|
+
|
23
|
+
# Raise exceptions instead of rendering exception templates
|
24
|
+
config.action_dispatch.show_exceptions = false
|
25
|
+
|
26
|
+
# Disable request forgery protection in test environment
|
27
|
+
config.action_controller.allow_forgery_protection = false
|
28
|
+
|
29
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
30
|
+
# The :test delivery method accumulates sent emails in the
|
31
|
+
# ActionMailer::Base.deliveries array.
|
32
|
+
# config.action_mailer.delivery_method = :test
|
33
|
+
|
34
|
+
# Raise exception on mass assignment protection for Active Record models
|
35
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
36
|
+
|
37
|
+
# Print deprecation notices to the stderr
|
38
|
+
config.active_support.deprecation = :stderr
|
39
|
+
end
|
File without changes
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure your secret_key_base is kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
|
13
|
+
# Although this is not needed for an api-only application, rails4
|
14
|
+
# requires secret_key_base or secret_toke to be defined, otherwise an
|
15
|
+
# error is raised.
|
16
|
+
# Using secret_token for rails3 compatibility. Change to secret_key_base
|
17
|
+
# to avoid deprecation warning.
|
18
|
+
# Can be safely removed in a rails3 api-only application.
|
19
|
+
Dummy::Application.config.secret_token = 'df98291699a229624c0907ad6236b289bc51369d1d1f2729b2c66cdad46b60cb2cb64b93d47b0d2fd9aa4f833bc8d4c98eaaed223f9d4b9ed684677f655611e8'
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
#
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper
|
4
|
+
|
5
|
+
# Enable parameter wrapping for JSON.
|
6
|
+
# ActiveSupport.on_load(:action_controller) do
|
7
|
+
# wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
8
|
+
# end
|
9
|
+
|
10
|
+
# To enable root element in JSON for ActiveRecord objects.
|
11
|
+
# ActiveSupport.on_load(:active_record) do
|
12
|
+
# self.include_root_in_json = true
|
13
|
+
# end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
+
#
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
7
|
+
# database schema. If you need to create the application database on another
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
+
#
|
12
|
+
# It's strongly recommended to check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(:version => 20130612073709) do
|
15
|
+
|
16
|
+
create_table "cadenero_accounts", :force => true do |t|
|
17
|
+
t.string "name"
|
18
|
+
t.string "subdomain"
|
19
|
+
t.string "authentication_token"
|
20
|
+
t.integer "owner_id"
|
21
|
+
t.datetime "created_at", :null => false
|
22
|
+
t.datetime "updated_at", :null => false
|
23
|
+
end
|
24
|
+
|
25
|
+
add_index "cadenero_accounts", ["authentication_token"], :name => "index_cadenero_accounts_on_authentication_token"
|
26
|
+
add_index "cadenero_accounts", ["owner_id"], :name => "index_cadenero_accounts_on_owner_id"
|
27
|
+
|
28
|
+
create_table "cadenero_members", :force => true do |t|
|
29
|
+
t.integer "account_id"
|
30
|
+
t.integer "user_id"
|
31
|
+
t.datetime "created_at", :null => false
|
32
|
+
t.datetime "updated_at", :null => false
|
33
|
+
end
|
34
|
+
|
35
|
+
add_index "cadenero_members", ["account_id"], :name => "index_cadenero_members_on_account_id"
|
36
|
+
add_index "cadenero_members", ["user_id"], :name => "index_cadenero_members_on_user_id"
|
37
|
+
|
38
|
+
create_table "cadenero_users", :force => true do |t|
|
39
|
+
t.string "email"
|
40
|
+
t.string "password_digest"
|
41
|
+
t.datetime "created_at", :null => false
|
42
|
+
t.datetime "updated_at", :null => false
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
Connecting to database specified by database.yml
|
2
|
+
Connecting to database specified by database.yml
|
3
|
+
Connecting to database specified by database.yml
|
4
|
+
Connecting to database specified by database.yml
|
5
|
+
Connecting to database specified by database.yml
|
6
|
+
Connecting to database specified by database.yml
|
7
|
+
Connecting to database specified by database.yml
|
8
|
+
Connecting to database specified by database.yml
|
9
|
+
Connecting to database specified by database.yml
|
10
|
+
Connecting to database specified by database.yml
|
11
|
+
Connecting to database specified by database.yml
|
12
|
+
Connecting to database specified by database.yml
|
13
|
+
Connecting to database specified by database.yml
|
14
|
+
Connecting to database specified by database.yml
|
15
|
+
Connecting to database specified by database.yml
|
16
|
+
Connecting to database specified by database.yml
|
17
|
+
Connecting to database specified by database.yml
|
18
|
+
[1m[36m (32.6ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) [0m
|
19
|
+
[1m[35m (5.9ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
20
|
+
[1m[36m (1.0ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
21
|
+
Migrating to CreateCadeneroV1Accounts (20130612061604)
|
22
|
+
[1m[35m (0.1ms)[0m BEGIN
|
23
|
+
[1m[36m (22.8ms)[0m [1mCREATE TABLE "cadenero_accounts" ("id" serial primary key, "name" character varying(255), "subdomain" character varying(255), "owner_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
24
|
+
[1m[35m (3.7ms)[0m CREATE INDEX "index_cadenero_accounts_on_owner_id" ON "cadenero_accounts" ("owner_id")
|
25
|
+
[1m[36m (9.8ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20130612061604')[0m
|
26
|
+
[1m[35m (2.0ms)[0m COMMIT
|
27
|
+
Migrating to CreateCadeneroV1Users (20130612064652)
|
28
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
29
|
+
[1m[35m (4.5ms)[0m CREATE TABLE "cadenero_users" ("id" serial primary key, "email" character varying(255), "password_digest" character varying(255), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
30
|
+
[1m[36m (0.3ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20130612064652')[0m
|
31
|
+
[1m[35m (1.6ms)[0m COMMIT
|
32
|
+
Migrating to CreateCadeneroV1Members (20130612073709)
|
33
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
34
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
35
|
+
Connecting to database specified by database.yml
|
36
|
+
[1m[36m (0.3ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
37
|
+
Migrating to CreateCadeneroV1Accounts (20130612061604)
|
38
|
+
Migrating to CreateCadeneroV1Users (20130612064652)
|
39
|
+
Migrating to CreateCadeneroV1Members (20130612073709)
|
40
|
+
[1m[35m (0.1ms)[0m BEGIN
|
41
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
42
|
+
Connecting to database specified by database.yml
|
43
|
+
[1m[36m (0.4ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
44
|
+
Migrating to CreateCadeneroV1Accounts (20130612061604)
|
45
|
+
Migrating to CreateCadeneroV1Users (20130612064652)
|
46
|
+
Migrating to CreateCadeneroV1Members (20130612073709)
|
47
|
+
[1m[35m (0.1ms)[0m BEGIN
|
48
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
49
|
+
Connecting to database specified by database.yml
|
50
|
+
[1m[36m (0.3ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
51
|
+
Migrating to CreateCadeneroV1Accounts (20130612061604)
|
52
|
+
Migrating to CreateCadeneroV1Users (20130612064652)
|
53
|
+
Migrating to CreateCadeneroV1Members (20130612073709)
|
54
|
+
[1m[35m (0.1ms)[0m BEGIN
|
55
|
+
[1m[36m (6.0ms)[0m [1mCREATE TABLE "cadenero_members" ("id" serial primary key, "account_id" integer, "user_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
56
|
+
[1m[35m (0.9ms)[0m CREATE INDEX "index_cadenero_members_on_account_id" ON "cadenero_members" ("account_id")
|
57
|
+
[1m[36m (1.1ms)[0m [1mCREATE INDEX "index_cadenero_members_on_user_id" ON "cadenero_members" ("user_id")[0m
|
58
|
+
[1m[35m (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20130612073709')
|
59
|
+
[1m[36m (2.0ms)[0m [1mCOMMIT[0m
|
60
|
+
Migrating to AddAuthenticationTokenToAccounts (20130612093908)
|
61
|
+
[1m[35m (0.2ms)[0m BEGIN
|
62
|
+
[1m[36m (1.2ms)[0m [1mALTER TABLE "cadenero_accounts" ADD COLUMN "authentication_token" character varying(255)[0m
|
63
|
+
[1m[35m (1.2ms)[0m CREATE INDEX "index_cadenero_accounts_on_authentication_token" ON "cadenero_accounts" ("authentication_token")
|
64
|
+
[1m[36m (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20130612093908')[0m
|
65
|
+
[1m[35m (10.3ms)[0m COMMIT
|
66
|
+
[1m[36m (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
67
|
+
Connecting to database specified by database.yml
|
68
|
+
Connecting to database specified by database.yml
|
69
|
+
Connecting to database specified by database.yml
|
70
|
+
Connecting to database specified by database.yml
|
71
|
+
Connecting to database specified by database.yml
|
72
|
+
[1m[36m (5.3ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) [0m
|
73
|
+
[1m[35m (1.9ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
74
|
+
[1m[36m (0.5ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
75
|
+
Migrating to CreateCadeneroV1Accounts (20130612061604)
|
76
|
+
[1m[35m (0.1ms)[0m BEGIN
|
77
|
+
[1m[36m (6.5ms)[0m [1mCREATE TABLE "cadenero_accounts" ("id" serial primary key, "name" character varying(255), "subdomain" character varying(255), "authentication_token" character varying(255), "owner_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
78
|
+
[1m[35m (1.1ms)[0m CREATE INDEX "index_cadenero_accounts_on_owner_id" ON "cadenero_accounts" ("owner_id")
|
79
|
+
[1m[36m (1.1ms)[0m [1mCREATE INDEX "index_cadenero_accounts_on_authentication_token" ON "cadenero_accounts" ("authentication_token")[0m
|
80
|
+
[1m[35m (0.9ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20130612061604')
|
81
|
+
[1m[36m (1.0ms)[0m [1mCOMMIT[0m
|
82
|
+
Migrating to CreateCadeneroV1Users (20130612064652)
|
83
|
+
[1m[35m (0.6ms)[0m BEGIN
|
84
|
+
[1m[36m (4.4ms)[0m [1mCREATE TABLE "cadenero_users" ("id" serial primary key, "email" character varying(255), "password_digest" character varying(255), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
85
|
+
[1m[35m (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20130612064652')
|
86
|
+
[1m[36m (1.0ms)[0m [1mCOMMIT[0m
|
87
|
+
Migrating to CreateCadeneroV1Members (20130612073709)
|
88
|
+
[1m[35m (0.2ms)[0m BEGIN
|
89
|
+
[1m[36m (18.0ms)[0m [1mCREATE TABLE "cadenero_members" ("id" serial primary key, "account_id" integer, "user_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
90
|
+
[1m[35m (1.3ms)[0m CREATE INDEX "index_cadenero_members_on_account_id" ON "cadenero_members" ("account_id")
|
91
|
+
[1m[36m (2.5ms)[0m [1mCREATE INDEX "index_cadenero_members_on_user_id" ON "cadenero_members" ("user_id")[0m
|
92
|
+
[1m[35m (0.7ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20130612073709')
|
93
|
+
[1m[36m (1.1ms)[0m [1mCOMMIT[0m
|
94
|
+
[1m[35m (0.2ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|