tb_checkout 1.0.3

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.
Files changed (122) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +162 -0
  4. data/Rakefile +24 -0
  5. data/app/assets/images/tb_checkout/admin/shopping_carts.png +0 -0
  6. data/app/assets/images/tb_checkout/admin/transactions.png +0 -0
  7. data/app/assets/javascripts/tb_checkout/admin/carts.js +2 -0
  8. data/app/assets/javascripts/tb_checkout/admin/transactions.js +2 -0
  9. data/app/assets/javascripts/tb_checkout/application.js +13 -0
  10. data/app/assets/javascripts/tb_checkout/cart_items.js +2 -0
  11. data/app/assets/javascripts/tb_checkout/carts.js +2 -0
  12. data/app/assets/javascripts/tb_checkout/transactions.js +2 -0
  13. data/app/assets/stylesheets/tb_checkout/admin/carts.css +4 -0
  14. data/app/assets/stylesheets/tb_checkout/admin/transactions.css +4 -0
  15. data/app/assets/stylesheets/tb_checkout/application.css +15 -0
  16. data/app/assets/stylesheets/tb_checkout/cart_items.css +4 -0
  17. data/app/assets/stylesheets/tb_checkout/carts.css +4 -0
  18. data/app/assets/stylesheets/tb_checkout/transactions.css +4 -0
  19. data/app/controllers/concerns/tb_checkout/controller_helpers.rb +16 -0
  20. data/app/controllers/tb_checkout/admin/carts_controller.rb +39 -0
  21. data/app/controllers/tb_checkout/admin/transactions_controller.rb +26 -0
  22. data/app/controllers/tb_checkout/application_controller.rb +6 -0
  23. data/app/controllers/tb_checkout/cart_items_controller.rb +63 -0
  24. data/app/controllers/tb_checkout/carts_controller.rb +8 -0
  25. data/app/controllers/tb_checkout/transactions_controller.rb +87 -0
  26. data/app/helpers/tb_checkout/admin/carts_helper.rb +13 -0
  27. data/app/helpers/tb_checkout/admin/transactions_helper.rb +16 -0
  28. data/app/helpers/tb_checkout/application_helper.rb +138 -0
  29. data/app/helpers/tb_checkout/transactions_helper.rb +2 -0
  30. data/app/models/concerns/tb_checkout/belongs_to_user_session.rb +15 -0
  31. data/app/models/concerns/tb_checkout/purchasable.rb +81 -0
  32. data/app/models/tb_checkout/basic_product.rb +6 -0
  33. data/app/models/tb_checkout/cart.rb +56 -0
  34. data/app/models/tb_checkout/cart_item.rb +48 -0
  35. data/app/models/tb_checkout/transaction.rb +253 -0
  36. data/app/views/tb_checkout/admin/carts/index.html.erb +54 -0
  37. data/app/views/tb_checkout/admin/carts/show.html.erb +45 -0
  38. data/app/views/tb_checkout/admin/transactions/_table.html.erb +24 -0
  39. data/app/views/tb_checkout/admin/transactions/index.html.erb +7 -0
  40. data/app/views/tb_checkout/admin/transactions/show.html.erb +70 -0
  41. data/app/views/tb_checkout/cart_items/create.html.erb +2 -0
  42. data/app/views/tb_checkout/cart_items/destroy.html.erb +2 -0
  43. data/app/views/tb_checkout/cart_items/update.html.erb +2 -0
  44. data/app/views/tb_checkout/carts/_cart.html.erb +65 -0
  45. data/app/views/tb_checkout/carts/show.html.erb +10 -0
  46. data/app/views/tb_checkout/transactions/_details.html.erb +17 -0
  47. data/app/views/tb_checkout/transactions/confirm.html.erb +11 -0
  48. data/app/views/tb_checkout/transactions/index.html.erb +29 -0
  49. data/app/views/tb_checkout/transactions/new.html.erb +90 -0
  50. data/app/views/tb_checkout/transactions/show.html.erb +14 -0
  51. data/config/locales/en.yml +23 -0
  52. data/config/routes.rb +20 -0
  53. data/db/migrate/20140703185256_create_tb_checkout_carts.rb +12 -0
  54. data/db/migrate/20140703185258_create_tb_checkout_cart_items.rb +15 -0
  55. data/db/migrate/20140703185259_create_tb_checkout_transactions.rb +23 -0
  56. data/db/migrate/20140707142350_create_tb_checkout_basic_products.rb +8 -0
  57. data/db/migrate/20140915202848_add_spud_user_and_session_id_to_transactions.rb +10 -0
  58. data/lib/tasks/tb_checkout_tasks.rake +19 -0
  59. data/lib/tb_checkout.rb +4 -0
  60. data/lib/tb_checkout/configuration.rb +8 -0
  61. data/lib/tb_checkout/engine.rb +36 -0
  62. data/lib/tb_checkout/schema.rb +51 -0
  63. data/lib/tb_checkout/version.rb +3 -0
  64. data/spec/controllers/tb_checkout/carts_controller_spec.rb +11 -0
  65. data/spec/controllers/tb_checkout/transactions_controller_spec.rb +110 -0
  66. data/spec/dummy/README.rdoc +28 -0
  67. data/spec/dummy/Rakefile +6 -0
  68. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  69. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  70. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  71. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  72. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  73. data/spec/dummy/bin/bundle +3 -0
  74. data/spec/dummy/bin/rails +4 -0
  75. data/spec/dummy/bin/rake +4 -0
  76. data/spec/dummy/config.ru +4 -0
  77. data/spec/dummy/config/application.rb +30 -0
  78. data/spec/dummy/config/boot.rb +5 -0
  79. data/spec/dummy/config/database.yml +13 -0
  80. data/spec/dummy/config/environment.rb +5 -0
  81. data/spec/dummy/config/environments/development.rb +37 -0
  82. data/spec/dummy/config/environments/production.rb +82 -0
  83. data/spec/dummy/config/environments/test.rb +39 -0
  84. data/spec/dummy/config/initializers/assets.rb +8 -0
  85. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  86. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  87. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  88. data/spec/dummy/config/initializers/inflections.rb +16 -0
  89. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  90. data/spec/dummy/config/initializers/session_store.rb +3 -0
  91. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  92. data/spec/dummy/config/locales/en.yml +23 -0
  93. data/spec/dummy/config/routes.rb +4 -0
  94. data/spec/dummy/config/secrets.yml +22 -0
  95. data/spec/dummy/db/migrate/20140915202259_create_spud_admin_permissions.tb_core.rb +12 -0
  96. data/spec/dummy/db/migrate/20140915202260_create_spud_users.tb_core.rb +30 -0
  97. data/spec/dummy/db/migrate/20140915202261_add_time_zone_to_spud_user.tb_core.rb +7 -0
  98. data/spec/dummy/db/migrate/20140915202262_add_scope_to_spud_admin_permissions.tb_core.rb +7 -0
  99. data/spec/dummy/db/migrate/20140915202263_create_spud_user_settings.tb_core.rb +12 -0
  100. data/spec/dummy/db/migrate/20140915202264_create_spud_roles.tb_core.rb +11 -0
  101. data/spec/dummy/db/migrate/20140915202265_create_spud_permissions.tb_core.rb +11 -0
  102. data/spec/dummy/db/migrate/20140915202266_create_spud_role_permissions.tb_core.rb +12 -0
  103. data/spec/dummy/db/migrate/20140915202267_drop_spud_admin_permissions.tb_core.rb +16 -0
  104. data/spec/dummy/db/migrate/20140915202268_create_tb_checkout_carts.tb_checkout_engine.rb +13 -0
  105. data/spec/dummy/db/migrate/20140915202269_create_tb_checkout_cart_items.tb_checkout_engine.rb +16 -0
  106. data/spec/dummy/db/migrate/20140915202270_create_tb_checkout_transactions.tb_checkout_engine.rb +24 -0
  107. data/spec/dummy/db/migrate/20140915202271_create_tb_checkout_basic_products.tb_checkout_engine.rb +9 -0
  108. data/spec/dummy/db/migrate/20140915234534_add_spud_user_and_session_id_to_transactions.tb_checkout_engine.rb +11 -0
  109. data/spec/dummy/db/schema.rb +135 -0
  110. data/spec/dummy/public/404.html +67 -0
  111. data/spec/dummy/public/422.html +67 -0
  112. data/spec/dummy/public/500.html +66 -0
  113. data/spec/dummy/public/favicon.ico +0 -0
  114. data/spec/factories/spud_users.rb +16 -0
  115. data/spec/factories/tb_checkout_basic_products.rb +8 -0
  116. data/spec/factories/tb_checkout_cart_items.rb +11 -0
  117. data/spec/factories/tb_checkout_carts.rb +14 -0
  118. data/spec/factories/tb_checkout_transactions.rb +37 -0
  119. data/spec/models/tb_checkout/transaction_spec.rb +5 -0
  120. data/spec/rails_helper.rb +73 -0
  121. data/spec/spec_helper.rb +85 -0
  122. metadata +335 -0
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
@@ -0,0 +1,16 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :spud_user do
5
+ sequence :email do |n|
6
+ "john.doe.#{n}@example.com"
7
+ end
8
+ sequence :login do |n|
9
+ "johndoe#{n}"
10
+ end
11
+ password "password"
12
+ password_confirmation "password"
13
+ first_name "John"
14
+ last_name "Doe"
15
+ end
16
+ end
@@ -0,0 +1,8 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :tb_checkout_basic_product, :class => 'TbCheckout::BasicProduct' do
5
+ price 9.99
6
+ description "A Basic Product"
7
+ end
8
+ end
@@ -0,0 +1,11 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :tb_checkout_cart_item, :class => 'TbCheckout::CartItem' do
5
+ association :cart, :factory => :tb_checkout_cart
6
+ association :item, :factory => :tb_checkout_basic_product
7
+ item_description "My Item"
8
+ item_price 9.99
9
+ quantity 1
10
+ end
11
+ end
@@ -0,0 +1,14 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :tb_checkout_cart, :class => 'TbCheckout::Cart' do
5
+ spud_user
6
+ session_id "8f74e68687a91c13901ae8809e8fdb6b"
7
+ is_completed false
8
+ is_abandoned false
9
+
10
+ after(:create) do |cart, evaluator|
11
+ cart.cart_items = create_list(:tb_checkout_cart_item, 3, :cart => cart)
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,37 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :tb_checkout_transaction, :class => 'TbCheckout::Transaction' do
5
+ association :cart, :factory => :tb_checkout_cart
6
+ amount_charged 0
7
+ card_type "visa"
8
+ card_number "4024007152451281"
9
+
10
+ # The following is NOT a valid cc number and should throw a basic validation error
11
+ trait :with_invalid_card do
12
+ card_number "4024007152451280"
13
+ end
14
+
15
+ # The following will trigger a gateway exception in ActiveMerchant::Billing::BogusGateway
16
+ trait :with_exception_card do
17
+ card_number "4556674473967422"
18
+ end
19
+
20
+ card_expiration { Date.today.next_year }
21
+ card_ccv 123
22
+ billing_first_name "John"
23
+ billing_last_name "Doe"
24
+ billing_address_1 "21 S Range Line Rd"
25
+ billing_address_2 "STE 200"
26
+ billing_city "Carmel"
27
+ billing_state "IN"
28
+ billing_postal 46032
29
+
30
+ trait :authorized do
31
+ after(:create) { |t| t.authorize! }
32
+ end
33
+ trait :captured do
34
+ after(:create) { |t| t.authorize! && t.capture! }
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,5 @@
1
+ require 'rails_helper'
2
+
3
+ RSpec.describe TbCheckout::Transaction, :type => :model do
4
+ pending "add some examples to (or delete) #{__FILE__}"
5
+ end
@@ -0,0 +1,73 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV["RAILS_ENV"] ||= 'test'
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require 'spec_helper'
6
+ require 'rspec/rails'
7
+ require 'database_cleaner'
8
+ require 'simplecov'
9
+ require 'factory_girl_rails'
10
+
11
+ # Authlogic helpers
12
+ require "authlogic/test_case"
13
+ include Authlogic::TestCase
14
+
15
+ # Track test coverage
16
+ SimpleCov.start 'rails'
17
+
18
+ # Add additional requires below this line. Rails is not loaded until this point!
19
+
20
+ # Requires supporting ruby files with custom matchers and macros, etc, in
21
+ # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
22
+ # run as spec files by default. This means that files in spec/support that end
23
+ # in _spec.rb will both be required and run as specs, causing the specs to be
24
+ # run twice. It is recommended that you do not name files matching this glob to
25
+ # end with _spec.rb. You can configure this pattern with the --pattern
26
+ # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
27
+ #
28
+ # The following line is provided for convenience purposes. It has the downside
29
+ # of increasing the boot-up time by auto-requiring all files in the support
30
+ # directory. Alternatively, in the individual `*_spec.rb` files, manually
31
+ # require only the support files necessary.
32
+ #
33
+ # Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
34
+ Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
35
+
36
+ # Checks for pending migrations before tests are run.
37
+ # If you are not using ActiveRecord, you can remove this line.
38
+ # ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
39
+
40
+ RSpec.configure do |config|
41
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
42
+ # examples within a transaction, remove the following line or assign false
43
+ # instead of true.
44
+ config.use_transactional_fixtures = true
45
+
46
+ # RSpec Rails can automatically mix in different behaviours to your tests
47
+ # based on their file location, for example enabling you to call `get` and
48
+ # `post` in specs under `spec/controllers`.
49
+ #
50
+ # You can disable this behaviour by removing the line below, and instead
51
+ # explicitly tag your specs with their type, e.g.:
52
+ #
53
+ # RSpec.describe UsersController, :type => :controller do
54
+ # # ...
55
+ # end
56
+ #
57
+ # The different available types are documented in the features, such as in
58
+ # https://relishapp.com/rspec/rspec-rails/docs
59
+ config.infer_spec_type_from_file_location!
60
+
61
+ # Clean the database as needed
62
+ # https://github.com/DatabaseCleaner/database_cleaner#rspec-example
63
+ config.before(:suite) do
64
+ DatabaseCleaner.strategy = :transaction
65
+ DatabaseCleaner.clean_with(:truncation)
66
+ end
67
+ config.around(:each) do |example|
68
+ DatabaseCleaner.cleaning do
69
+ example.run
70
+ end
71
+ end
72
+
73
+ end
@@ -0,0 +1,85 @@
1
+ # This file was generated by the `rails generate rspec:install` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause this
4
+ # file to always be loaded, without a need to explicitly require it in any files.
5
+ #
6
+ # Given that it is always loaded, you are encouraged to keep this file as
7
+ # light-weight as possible. Requiring heavyweight dependencies from this file
8
+ # will add to the boot time of your test suite on EVERY test run, even for an
9
+ # individual file that may not need all of that loaded. Instead, consider making
10
+ # a separate helper file that requires the additional dependencies and performs
11
+ # the additional setup, and require it from the spec files that actually need it.
12
+ #
13
+ # The `.rspec` file also contains a few flags that are not defaults but that
14
+ # users commonly want.
15
+ #
16
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
17
+ RSpec.configure do |config|
18
+ # rspec-expectations config goes here. You can use an alternate
19
+ # assertion/expectation library such as wrong or the stdlib/minitest
20
+ # assertions if you prefer.
21
+ config.expect_with :rspec do |expectations|
22
+ # This option will default to `true` in RSpec 4. It makes the `description`
23
+ # and `failure_message` of custom matchers include text for helper methods
24
+ # defined using `chain`, e.g.:
25
+ # be_bigger_than(2).and_smaller_than(4).description
26
+ # # => "be bigger than 2 and smaller than 4"
27
+ # ...rather than:
28
+ # # => "be bigger than 2"
29
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
30
+ end
31
+
32
+ # rspec-mocks config goes here. You can use an alternate test double
33
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
34
+ config.mock_with :rspec do |mocks|
35
+ # Prevents you from mocking or stubbing a method that does not exist on
36
+ # a real object. This is generally recommended, and will default to
37
+ # `true` in RSpec 4.
38
+ mocks.verify_partial_doubles = true
39
+ end
40
+
41
+ # The settings below are suggested to provide a good initial experience
42
+ # with RSpec, but feel free to customize to your heart's content.
43
+ =begin
44
+ # These two settings work together to allow you to limit a spec run
45
+ # to individual examples or groups you care about by tagging them with
46
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
47
+ # get run.
48
+ config.filter_run :focus
49
+ config.run_all_when_everything_filtered = true
50
+
51
+ # Limits the available syntax to the non-monkey patched syntax that is recommended.
52
+ # For more details, see:
53
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
54
+ # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
55
+ # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
56
+ config.disable_monkey_patching!
57
+
58
+ # Many RSpec users commonly either run the entire suite or an individual
59
+ # file, and it's useful to allow more verbose output when running an
60
+ # individual spec file.
61
+ if config.files_to_run.one?
62
+ # Use the documentation formatter for detailed output,
63
+ # unless a formatter has already been configured
64
+ # (e.g. via a command-line flag).
65
+ config.default_formatter = 'doc'
66
+ end
67
+
68
+ # Print the 10 slowest examples and example groups at the
69
+ # end of the spec run, to help surface which specs are running
70
+ # particularly slow.
71
+ config.profile_examples = 10
72
+
73
+ # Run specs in random order to surface order dependencies. If you find an
74
+ # order dependency and want to debug it, you can fix the order by providing
75
+ # the seed, which is printed after each run.
76
+ # --seed 1234
77
+ config.order = :random
78
+
79
+ # Seed global randomization in this process using the `--seed` CLI option.
80
+ # Setting this allows you to use `--seed` to deterministically reproduce
81
+ # test failures related to randomization by passing the same `--seed` value
82
+ # as the one that triggered the failure.
83
+ Kernel.srand config.seed
84
+ =end
85
+ end