factory_girl-remote_api 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +168 -0
  3. data/Rakefile +58 -0
  4. data/app/assets/javascripts/factory_girl-remote_api/application.js +13 -0
  5. data/app/assets/stylesheets/factory_girl-remote_api/application.css +13 -0
  6. data/app/controllers/factory_girl/remote_api/application_controller.rb +6 -0
  7. data/app/controllers/factory_girl/remote_api/factories_controller.rb +24 -0
  8. data/app/helpers/factory_girl/remote_api/application_helper.rb +4 -0
  9. data/app/views/layouts/factory_girl/remote_api/application.html.erb +14 -0
  10. data/config/routes.rb +4 -0
  11. data/lib/factory_girl/remote_api/configuration.rb +21 -0
  12. data/lib/factory_girl/remote_api/engine.rb +14 -0
  13. data/lib/factory_girl/remote_api/remote_factory.rb +31 -0
  14. data/lib/factory_girl/remote_api/request.rb +40 -0
  15. data/lib/factory_girl/remote_api/version.rb +5 -0
  16. data/lib/factory_girl/remote_api.rb +35 -0
  17. data/spec/dummy_31/Rakefile +7 -0
  18. data/spec/dummy_31/app/assets/javascripts/application.js +9 -0
  19. data/spec/dummy_31/app/assets/stylesheets/application.css +7 -0
  20. data/spec/dummy_31/app/controllers/application_controller.rb +3 -0
  21. data/spec/dummy_31/app/helpers/application_helper.rb +2 -0
  22. data/spec/dummy_31/app/models/user.rb +3 -0
  23. data/spec/dummy_31/app/views/layouts/application.html.erb +14 -0
  24. data/spec/dummy_31/config/application.rb +45 -0
  25. data/spec/dummy_31/config/boot.rb +10 -0
  26. data/spec/dummy_31/config/database.yml +25 -0
  27. data/spec/dummy_31/config/environment.rb +5 -0
  28. data/spec/dummy_31/config/environments/development.rb +30 -0
  29. data/spec/dummy_31/config/environments/production.rb +60 -0
  30. data/spec/dummy_31/config/environments/test.rb +39 -0
  31. data/spec/dummy_31/config/initializers/backtrace_silencers.rb +7 -0
  32. data/spec/dummy_31/config/initializers/inflections.rb +10 -0
  33. data/spec/dummy_31/config/initializers/mime_types.rb +5 -0
  34. data/spec/dummy_31/config/initializers/secret_token.rb +7 -0
  35. data/spec/dummy_31/config/initializers/session_store.rb +8 -0
  36. data/spec/dummy_31/config/initializers/wrap_parameters.rb +14 -0
  37. data/spec/dummy_31/config/locales/en.yml +5 -0
  38. data/spec/dummy_31/config/routes.rb +3 -0
  39. data/spec/dummy_31/config.ru +4 -0
  40. data/spec/dummy_31/db/development.sqlite3 +0 -0
  41. data/spec/dummy_31/db/migrate/20130607202020_create_users.rb +10 -0
  42. data/spec/dummy_31/db/schema.rb +23 -0
  43. data/spec/dummy_31/db/test.sqlite3 +0 -0
  44. data/spec/dummy_31/log/test.log +130 -0
  45. data/spec/dummy_31/public/404.html +26 -0
  46. data/spec/dummy_31/public/422.html +26 -0
  47. data/spec/dummy_31/public/500.html +26 -0
  48. data/spec/dummy_31/public/favicon.ico +0 -0
  49. data/spec/dummy_31/script/rails +6 -0
  50. data/spec/dummy_31/spec/factories/users.rb +13 -0
  51. data/spec/dummy_32/README.rdoc +261 -0
  52. data/spec/dummy_32/Rakefile +7 -0
  53. data/spec/dummy_32/app/assets/javascripts/application.js +15 -0
  54. data/spec/dummy_32/app/assets/stylesheets/application.css +13 -0
  55. data/spec/dummy_32/app/controllers/application_controller.rb +3 -0
  56. data/spec/dummy_32/app/helpers/application_helper.rb +2 -0
  57. data/spec/dummy_32/app/models/user.rb +3 -0
  58. data/spec/dummy_32/app/views/layouts/application.html.erb +14 -0
  59. data/spec/dummy_32/config/application.rb +65 -0
  60. data/spec/dummy_32/config/boot.rb +10 -0
  61. data/spec/dummy_32/config/database.yml +25 -0
  62. data/spec/dummy_32/config/environment.rb +5 -0
  63. data/spec/dummy_32/config/environments/development.rb +37 -0
  64. data/spec/dummy_32/config/environments/production.rb +67 -0
  65. data/spec/dummy_32/config/environments/test.rb +37 -0
  66. data/spec/dummy_32/config/initializers/backtrace_silencers.rb +7 -0
  67. data/spec/dummy_32/config/initializers/inflections.rb +15 -0
  68. data/spec/dummy_32/config/initializers/mime_types.rb +5 -0
  69. data/spec/dummy_32/config/initializers/secret_token.rb +7 -0
  70. data/spec/dummy_32/config/initializers/session_store.rb +8 -0
  71. data/spec/dummy_32/config/initializers/wrap_parameters.rb +14 -0
  72. data/spec/dummy_32/config/locales/en.yml +5 -0
  73. data/spec/dummy_32/config/routes.rb +3 -0
  74. data/spec/dummy_32/config.ru +4 -0
  75. data/spec/dummy_32/db/development.sqlite3 +0 -0
  76. data/spec/dummy_32/db/migrate/20130607202020_create_users.rb +10 -0
  77. data/spec/dummy_32/db/schema.rb +23 -0
  78. data/spec/dummy_32/db/test.sqlite3 +0 -0
  79. data/spec/dummy_32/log/test.log +1520 -0
  80. data/spec/dummy_32/public/404.html +26 -0
  81. data/spec/dummy_32/public/422.html +26 -0
  82. data/spec/dummy_32/public/500.html +25 -0
  83. data/spec/dummy_32/public/favicon.ico +0 -0
  84. data/spec/dummy_32/script/rails +6 -0
  85. data/spec/dummy_32/spec/factories/users.rb +13 -0
  86. data/spec/dummy_40/README.rdoc +28 -0
  87. data/spec/dummy_40/Rakefile +6 -0
  88. data/spec/dummy_40/app/assets/javascripts/application.js +13 -0
  89. data/spec/dummy_40/app/assets/stylesheets/application.css +13 -0
  90. data/spec/dummy_40/app/controllers/application_controller.rb +5 -0
  91. data/spec/dummy_40/app/helpers/application_helper.rb +2 -0
  92. data/spec/dummy_40/app/models/user.rb +2 -0
  93. data/spec/dummy_40/app/views/layouts/application.html.erb +14 -0
  94. data/spec/dummy_40/bin/bundle +3 -0
  95. data/spec/dummy_40/bin/rails +4 -0
  96. data/spec/dummy_40/bin/rake +4 -0
  97. data/spec/dummy_40/config/application.rb +23 -0
  98. data/spec/dummy_40/config/boot.rb +5 -0
  99. data/spec/dummy_40/config/database.yml +25 -0
  100. data/spec/dummy_40/config/environment.rb +5 -0
  101. data/spec/dummy_40/config/environments/development.rb +29 -0
  102. data/spec/dummy_40/config/environments/production.rb +80 -0
  103. data/spec/dummy_40/config/environments/test.rb +36 -0
  104. data/spec/dummy_40/config/initializers/backtrace_silencers.rb +7 -0
  105. data/spec/dummy_40/config/initializers/filter_parameter_logging.rb +4 -0
  106. data/spec/dummy_40/config/initializers/inflections.rb +16 -0
  107. data/spec/dummy_40/config/initializers/mime_types.rb +5 -0
  108. data/spec/dummy_40/config/initializers/secret_token.rb +12 -0
  109. data/spec/dummy_40/config/initializers/session_store.rb +3 -0
  110. data/spec/dummy_40/config/initializers/wrap_parameters.rb +14 -0
  111. data/spec/dummy_40/config/locales/en.yml +23 -0
  112. data/spec/dummy_40/config/routes.rb +4 -0
  113. data/spec/dummy_40/config.ru +4 -0
  114. data/spec/dummy_40/db/migrate/20130607202020_create_users.rb +10 -0
  115. data/spec/dummy_40/db/schema.rb +23 -0
  116. data/spec/dummy_40/db/test.sqlite3 +0 -0
  117. data/spec/dummy_40/log/test.log +175 -0
  118. data/spec/dummy_40/public/404.html +58 -0
  119. data/spec/dummy_40/public/422.html +58 -0
  120. data/spec/dummy_40/public/500.html +57 -0
  121. data/spec/dummy_40/public/favicon.ico +0 -0
  122. data/spec/dummy_40/spec/factories/users.rb +13 -0
  123. data/spec/factory_girl/remote_api/configuration_spec.rb +24 -0
  124. data/spec/factory_girl/remote_api/request_spec.rb +34 -0
  125. data/spec/factory_girl/remote_api_spec.rb +21 -0
  126. data/spec/features/client_factory_requests_spec.rb +59 -0
  127. data/spec/features/server_factory_requests_spec.rb +50 -0
  128. data/spec/spec_helper.rb +37 -0
  129. data/spec/support/database_cleaner.rb +11 -0
  130. data/spec/support/require_dummy_factories.rb +2 -0
  131. data/spec/support/stub_with_real_response.rb +12 -0
  132. data.tar.gz.sig +0 -0
  133. metadata +485 -0
  134. metadata.gz.sig +0 -0
@@ -0,0 +1,60 @@
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
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to Rails.root.join("public/assets")
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Use a different logger for distributed setups
37
+ # config.logger = SyslogLogger.new
38
+
39
+ # Use a different cache store in production
40
+ # config.cache_store = :mem_cache_store
41
+
42
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
43
+ # config.action_controller.asset_host = "http://assets.example.com"
44
+
45
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
46
+ # config.assets.precompile += %w( search.js )
47
+
48
+ # Disable delivery errors, bad email addresses will be ignored
49
+ # config.action_mailer.raise_delivery_errors = false
50
+
51
+ # Enable threaded mode
52
+ # config.threadsafe!
53
+
54
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
55
+ # the I18n.default_locale when a translation can not be found)
56
+ config.i18n.fallbacks = true
57
+
58
+ # Send deprecation notices to registered listeners
59
+ config.active_support.deprecation = :notify
60
+ 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
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
33
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
34
+ # like if you have constraints or database-specific column types
35
+ # config.active_record.schema_format = :sql
36
+
37
+ # Print deprecation notices to the stderr
38
+ config.active_support.deprecation = :stderr
39
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
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
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = '709925e10f4c893c5f33b18da76729fa7b20f68e3bf2e14e3240240f87c7d6eeac0748af691d6bac680130af8f88f26991a10d53167fb0c6b43ea0dfc0895bf9'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ mount FactoryGirl::RemoteApi::Engine => "/factories"
3
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,10 @@
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :users do |t|
4
+ t.string :first_name
5
+ t.string :last_name
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,23 @@
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 => 20130607202020) do
15
+
16
+ create_table "users", :force => true do |t|
17
+ t.string "first_name"
18
+ t.string "last_name"
19
+ t.datetime "created_at"
20
+ t.datetime "updated_at"
21
+ end
22
+
23
+ end
Binary file
@@ -0,0 +1,130 @@
1
+  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
2
+ Migrating to CreateUsers (20130607202020)
3
+  (0.3ms) select sqlite_version(*)
4
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
5
+  (0.0ms) PRAGMA index_list("users")
6
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
7
+  (0.2ms) select sqlite_version(*)
8
+  (2.2ms) DROP TABLE "users"
9
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime)
10
+  (0.1ms) SELECT version FROM "schema_migrations"
11
+
12
+
13
+ Started GET "/factories/attributes_for/user?user[first_name]=James" for 127.0.0.1 at 2013-06-18 11:23:00 -0700
14
+ Processing by FactoryGirl::RemoteApi::FactoriesController#show as JSON
15
+ Parameters: {"user"=>{"first_name"=>"James"}, "factory_method"=>"attributes_for", "factory"=>"user"}
16
+ Completed 200 OK in 36ms (Views: 0.3ms | ActiveRecord: 0.0ms)
17
+  (1.1ms) SELECT COUNT(*) FROM "users" 
18
+  (0.1ms) SELECT COUNT(*) FROM "users"
19
+
20
+
21
+ Started GET "/factories/user?user[first_name]=James" for 127.0.0.1 at 2013-06-18 11:23:00 -0700
22
+ Processing by FactoryGirl::RemoteApi::FactoriesController#create as JSON
23
+ Parameters: {"user"=>{"first_name"=>"James"}, "factory"=>"user"}
24
+  (0.0ms) SAVEPOINT active_record_1
25
+ SQL (3.7ms) INSERT INTO "users" ("created_at", "first_name", "last_name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 18 Jun 2013 18:23:00 UTC +00:00], ["first_name", "James"], ["last_name", "Doe"], ["updated_at", Tue, 18 Jun 2013 18:23:00 UTC +00:00]]
26
+  (0.0ms) RELEASE SAVEPOINT active_record_1
27
+ Completed 200 OK in 12ms (Views: 0.3ms | ActiveRecord: 0.0ms)
28
+  (0.1ms) SELECT COUNT(*) FROM "users"
29
+
30
+
31
+ Started GET "/factories/attributes_for/user" for 127.0.0.1 at 2013-06-18 11:23:00 -0700
32
+ Processing by FactoryGirl::RemoteApi::FactoriesController#show as JSON
33
+ Parameters: {"factory_method"=>"attributes_for", "factory"=>"user"}
34
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
35
+  (0.1ms) SELECT COUNT(*) FROM "users" 
36
+
37
+
38
+ Started GET "/factories/build/user?user[first_name]=James" for 127.0.0.1 at 2013-06-18 11:23:00 -0700
39
+ Processing by FactoryGirl::RemoteApi::FactoriesController#show as JSON
40
+ Parameters: {"user"=>{"first_name"=>"James"}, "factory_method"=>"build", "factory"=>"user"}
41
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
42
+  (0.1ms) SELECT COUNT(*) FROM "users"
43
+
44
+
45
+ Started GET "/factories/build/user" for 127.0.0.1 at 2013-06-18 11:23:00 -0700
46
+ Processing by FactoryGirl::RemoteApi::FactoriesController#show as JSON
47
+ Parameters: {"factory_method"=>"build", "factory"=>"user"}
48
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
49
+  (0.1ms) SELECT COUNT(*) FROM "users" 
50
+  (0.1ms) SELECT COUNT(*) FROM "users"
51
+
52
+
53
+ Started GET "/factories/authenticated_user?authenticated_user[first_name]=James&authenticated_user[parent_factory]=user" for 127.0.0.1 at 2013-06-18 11:23:00 -0700
54
+ Processing by FactoryGirl::RemoteApi::FactoriesController#create as JSON
55
+ Parameters: {"authenticated_user"=>{"first_name"=>"James", "parent_factory"=>"user"}, "factory"=>"authenticated_user"}
56
+  (0.0ms) SAVEPOINT active_record_1
57
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "first_name", "last_name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 18 Jun 2013 18:23:00 UTC +00:00], ["first_name", "James"], ["last_name", "Doe"], ["updated_at", Tue, 18 Jun 2013 18:23:00 UTC +00:00]]
58
+  (0.0ms) RELEASE SAVEPOINT active_record_1
59
+ Completed 200 OK in 4ms (Views: 0.4ms | ActiveRecord: 0.0ms)
60
+  (0.1ms) SELECT COUNT(*) FROM "users"
61
+  (0.1ms) SELECT COUNT(*) FROM "users" 
62
+
63
+
64
+ Started GET "/factories/user" for 127.0.0.1 at 2013-06-18 11:23:00 -0700
65
+ Processing by FactoryGirl::RemoteApi::FactoriesController#create as JSON
66
+ Parameters: {"factory"=>"user"}
67
+  (0.0ms) SAVEPOINT active_record_1
68
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "first_name", "last_name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 18 Jun 2013 18:23:00 UTC +00:00], ["first_name", "John"], ["last_name", "Doe"], ["updated_at", Tue, 18 Jun 2013 18:23:00 UTC +00:00]]
69
+  (0.0ms) RELEASE SAVEPOINT active_record_1
70
+ Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.0ms)
71
+  (0.0ms) SELECT COUNT(*) FROM "users" 
72
+ User Load (0.1ms) SELECT "users".* FROM "users" LIMIT 1
73
+
74
+
75
+ Started GET "/factories/attributes_for/user?user[first_name]=James" for 127.0.0.1 at 2013-06-18 11:23:00 -0700
76
+ Processing by FactoryGirl::RemoteApi::FactoriesController#show as JSON
77
+ Parameters: {"user"=>{"first_name"=>"James"}, "factory_method"=>"attributes_for", "factory"=>"user"}
78
+ Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)
79
+  (0.1ms) SELECT COUNT(*) FROM "users" 
80
+
81
+
82
+ Started GET "/factories/user?user[first_name]=James" for 127.0.0.1 at 2013-06-18 11:23:00 -0700
83
+ Processing by FactoryGirl::RemoteApi::FactoriesController#create as JSON
84
+ Parameters: {"user"=>{"first_name"=>"James"}, "factory"=>"user"}
85
+  (0.0ms) SAVEPOINT active_record_1
86
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "first_name", "last_name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 18 Jun 2013 18:23:00 UTC +00:00], ["first_name", "James"], ["last_name", "Doe"], ["updated_at", Tue, 18 Jun 2013 18:23:00 UTC +00:00]]
87
+  (0.0ms) RELEASE SAVEPOINT active_record_1
88
+ Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.0ms)
89
+  (0.1ms) SELECT COUNT(*) FROM "users" 
90
+
91
+
92
+ Started GET "/factories/attributes_for/user" for 127.0.0.1 at 2013-06-18 11:23:00 -0700
93
+ Processing by FactoryGirl::RemoteApi::FactoriesController#show as JSON
94
+ Parameters: {"factory_method"=>"attributes_for", "factory"=>"user"}
95
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
96
+  (0.1ms) SELECT COUNT(*) FROM "users"
97
+
98
+
99
+ Started GET "/factories/build/user?user[first_name]=James" for 127.0.0.1 at 2013-06-18 11:23:00 -0700
100
+ Processing by FactoryGirl::RemoteApi::FactoriesController#show as JSON
101
+ Parameters: {"user"=>{"first_name"=>"James"}, "factory_method"=>"build", "factory"=>"user"}
102
+ Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)
103
+  (0.1ms) SELECT COUNT(*) FROM "users" 
104
+
105
+
106
+ Started GET "/factories/build/user" for 127.0.0.1 at 2013-06-18 11:23:00 -0700
107
+ Processing by FactoryGirl::RemoteApi::FactoriesController#show as JSON
108
+ Parameters: {"factory_method"=>"build", "factory"=>"user"}
109
+ Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)
110
+  (0.2ms) SELECT COUNT(*) FROM "users"
111
+
112
+
113
+ Started GET "/factories/authenticated_user?authenticated_user[first_name]=James&authenticated_user[parent_factory]=user" for 127.0.0.1 at 2013-06-18 11:23:00 -0700
114
+ Processing by FactoryGirl::RemoteApi::FactoriesController#create as JSON
115
+ Parameters: {"authenticated_user"=>{"first_name"=>"James", "parent_factory"=>"user"}, "factory"=>"authenticated_user"}
116
+  (0.0ms) SAVEPOINT active_record_1
117
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "first_name", "last_name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 18 Jun 2013 18:23:00 UTC +00:00], ["first_name", "James"], ["last_name", "Doe"], ["updated_at", Tue, 18 Jun 2013 18:23:00 UTC +00:00]]
118
+  (0.0ms) RELEASE SAVEPOINT active_record_1
119
+ Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.0ms)
120
+  (0.1ms) SELECT COUNT(*) FROM "users"
121
+
122
+
123
+ Started GET "/factories/user" for 127.0.0.1 at 2013-06-18 11:23:00 -0700
124
+ Processing by FactoryGirl::RemoteApi::FactoriesController#create as JSON
125
+ Parameters: {"factory"=>"user"}
126
+  (0.0ms) SAVEPOINT active_record_1
127
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "first_name", "last_name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 18 Jun 2013 18:23:00 UTC +00:00], ["first_name", "John"], ["last_name", "Doe"], ["updated_at", Tue, 18 Jun 2013 18:23:00 UTC +00:00]]
128
+  (0.0ms) RELEASE SAVEPOINT active_record_1
129
+ Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.0ms)
130
+  (0.1ms) SELECT COUNT(*) FROM "users"
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
+ </div>
25
+ </body>
26
+ </html>
File without changes
@@ -0,0 +1,6 @@
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'
@@ -0,0 +1,13 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :user do
5
+ first_name 'John'
6
+ last_name 'Doe'
7
+ end
8
+
9
+ factory :authenticated_user, parent: :user do
10
+ first_name 'Jane'
11
+ last_name 'Doe'
12
+ end
13
+ end