effective_orders 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +856 -0
  4. data/Rakefile +24 -0
  5. data/app/assets/images/effective_orders/stripe_connect.png +0 -0
  6. data/app/assets/javascripts/effective_orders/shipping_address_toggle.js.coffee +30 -0
  7. data/app/assets/javascripts/effective_orders/stripe_charges.js.coffee +26 -0
  8. data/app/assets/javascripts/effective_orders/stripe_subscriptions.js.coffee +28 -0
  9. data/app/assets/javascripts/effective_orders.js +2 -0
  10. data/app/assets/stylesheets/effective_orders/_order.scss +30 -0
  11. data/app/assets/stylesheets/effective_orders.css.scss +1 -0
  12. data/app/controllers/admin/customers_controller.rb +15 -0
  13. data/app/controllers/admin/orders_controller.rb +22 -0
  14. data/app/controllers/effective/carts_controller.rb +70 -0
  15. data/app/controllers/effective/orders_controller.rb +191 -0
  16. data/app/controllers/effective/providers/moneris.rb +94 -0
  17. data/app/controllers/effective/providers/paypal.rb +29 -0
  18. data/app/controllers/effective/providers/stripe.rb +125 -0
  19. data/app/controllers/effective/providers/stripe_connect.rb +47 -0
  20. data/app/controllers/effective/subscriptions_controller.rb +123 -0
  21. data/app/controllers/effective/webhooks_controller.rb +86 -0
  22. data/app/helpers/effective_carts_helper.rb +90 -0
  23. data/app/helpers/effective_orders_helper.rb +108 -0
  24. data/app/helpers/effective_paypal_helper.rb +37 -0
  25. data/app/helpers/effective_stripe_helper.rb +63 -0
  26. data/app/mailers/effective/orders_mailer.rb +64 -0
  27. data/app/models/concerns/acts_as_purchasable.rb +134 -0
  28. data/app/models/effective/access_denied.rb +17 -0
  29. data/app/models/effective/cart.rb +65 -0
  30. data/app/models/effective/cart_item.rb +40 -0
  31. data/app/models/effective/customer.rb +61 -0
  32. data/app/models/effective/datatables/customers.rb +45 -0
  33. data/app/models/effective/datatables/orders.rb +53 -0
  34. data/app/models/effective/order.rb +247 -0
  35. data/app/models/effective/order_item.rb +69 -0
  36. data/app/models/effective/stripe_charge.rb +35 -0
  37. data/app/models/effective/subscription.rb +95 -0
  38. data/app/models/inputs/price_field.rb +63 -0
  39. data/app/models/inputs/price_form_input.rb +7 -0
  40. data/app/models/inputs/price_formtastic_input.rb +9 -0
  41. data/app/models/inputs/price_input.rb +19 -0
  42. data/app/models/inputs/price_simple_form_input.rb +8 -0
  43. data/app/models/validators/effective/sold_out_validator.rb +7 -0
  44. data/app/views/active_admin/effective_orders/orders/_show.html.haml +70 -0
  45. data/app/views/admin/customers/_actions.html.haml +2 -0
  46. data/app/views/admin/customers/index.html.haml +10 -0
  47. data/app/views/admin/orders/index.html.haml +7 -0
  48. data/app/views/admin/orders/show.html.haml +11 -0
  49. data/app/views/effective/carts/_cart.html.haml +33 -0
  50. data/app/views/effective/carts/show.html.haml +18 -0
  51. data/app/views/effective/orders/_checkout_step_1.html.haml +39 -0
  52. data/app/views/effective/orders/_checkout_step_2.html.haml +18 -0
  53. data/app/views/effective/orders/_my_purchases.html.haml +15 -0
  54. data/app/views/effective/orders/_order.html.haml +4 -0
  55. data/app/views/effective/orders/_order_header.html.haml +21 -0
  56. data/app/views/effective/orders/_order_items.html.haml +39 -0
  57. data/app/views/effective/orders/_order_payment_details.html.haml +11 -0
  58. data/app/views/effective/orders/_order_shipping.html.haml +19 -0
  59. data/app/views/effective/orders/_order_user_fields.html.haml +10 -0
  60. data/app/views/effective/orders/checkout.html.haml +3 -0
  61. data/app/views/effective/orders/declined.html.haml +10 -0
  62. data/app/views/effective/orders/moneris/_form.html.haml +34 -0
  63. data/app/views/effective/orders/my_purchases.html.haml +6 -0
  64. data/app/views/effective/orders/my_sales.html.haml +28 -0
  65. data/app/views/effective/orders/new.html.haml +4 -0
  66. data/app/views/effective/orders/paypal/_form.html.haml +5 -0
  67. data/app/views/effective/orders/purchased.html.haml +10 -0
  68. data/app/views/effective/orders/show.html.haml +17 -0
  69. data/app/views/effective/orders/stripe/_form.html.haml +8 -0
  70. data/app/views/effective/orders/stripe/_subscription_fields.html.haml +7 -0
  71. data/app/views/effective/orders_mailer/order_receipt_to_admin.html.haml +8 -0
  72. data/app/views/effective/orders_mailer/order_receipt_to_buyer.html.haml +8 -0
  73. data/app/views/effective/orders_mailer/order_receipt_to_seller.html.haml +30 -0
  74. data/app/views/effective/subscriptions/index.html.haml +16 -0
  75. data/app/views/effective/subscriptions/new.html.haml +10 -0
  76. data/app/views/effective/subscriptions/show.html.haml +49 -0
  77. data/config/routes.rb +57 -0
  78. data/db/migrate/01_create_effective_orders.rb.erb +91 -0
  79. data/db/upgrade/02_upgrade_effective_orders_from03x.rb.erb +29 -0
  80. data/db/upgrade/upgrade_price_column_on_table.rb.erb +17 -0
  81. data/lib/effective_orders/engine.rb +52 -0
  82. data/lib/effective_orders/version.rb +3 -0
  83. data/lib/effective_orders.rb +76 -0
  84. data/lib/generators/effective_orders/install_generator.rb +38 -0
  85. data/lib/generators/effective_orders/upgrade_from03x_generator.rb +34 -0
  86. data/lib/generators/effective_orders/upgrade_price_column_generator.rb +34 -0
  87. data/lib/generators/templates/README +1 -0
  88. data/lib/generators/templates/effective_orders.rb +210 -0
  89. data/spec/controllers/carts_controller_spec.rb +143 -0
  90. data/spec/controllers/moneris_orders_controller_spec.rb +245 -0
  91. data/spec/controllers/orders_controller_spec.rb +418 -0
  92. data/spec/controllers/stripe_orders_controller_spec.rb +127 -0
  93. data/spec/controllers/webhooks_controller_spec.rb +79 -0
  94. data/spec/dummy/README.rdoc +8 -0
  95. data/spec/dummy/Rakefile +6 -0
  96. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  97. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  98. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  99. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  100. data/spec/dummy/app/models/product.rb +17 -0
  101. data/spec/dummy/app/models/product_with_float_price.rb +17 -0
  102. data/spec/dummy/app/models/user.rb +28 -0
  103. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  104. data/spec/dummy/bin/bundle +3 -0
  105. data/spec/dummy/bin/rails +4 -0
  106. data/spec/dummy/bin/rake +4 -0
  107. data/spec/dummy/config/application.rb +31 -0
  108. data/spec/dummy/config/boot.rb +5 -0
  109. data/spec/dummy/config/database.yml +25 -0
  110. data/spec/dummy/config/environment.rb +5 -0
  111. data/spec/dummy/config/environments/development.rb +37 -0
  112. data/spec/dummy/config/environments/production.rb +83 -0
  113. data/spec/dummy/config/environments/test.rb +39 -0
  114. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  115. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  116. data/spec/dummy/config/initializers/devise.rb +254 -0
  117. data/spec/dummy/config/initializers/effective_addresses.rb +15 -0
  118. data/spec/dummy/config/initializers/effective_orders.rb +22 -0
  119. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  120. data/spec/dummy/config/initializers/inflections.rb +16 -0
  121. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  122. data/spec/dummy/config/initializers/session_store.rb +3 -0
  123. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  124. data/spec/dummy/config/locales/en.yml +23 -0
  125. data/spec/dummy/config/routes.rb +3 -0
  126. data/spec/dummy/config/secrets.yml +22 -0
  127. data/spec/dummy/config.ru +4 -0
  128. data/spec/dummy/db/schema.rb +142 -0
  129. data/spec/dummy/db/test.sqlite3 +0 -0
  130. data/spec/dummy/log/development.log +487 -0
  131. data/spec/dummy/log/test.log +347 -0
  132. data/spec/dummy/public/404.html +67 -0
  133. data/spec/dummy/public/422.html +67 -0
  134. data/spec/dummy/public/500.html +66 -0
  135. data/spec/dummy/public/favicon.ico +0 -0
  136. data/spec/helpers/effective_orders_helper_spec.rb +21 -0
  137. data/spec/models/acts_as_purchasable_spec.rb +107 -0
  138. data/spec/models/customer_spec.rb +71 -0
  139. data/spec/models/factories_spec.rb +13 -0
  140. data/spec/models/order_item_spec.rb +35 -0
  141. data/spec/models/order_spec.rb +323 -0
  142. data/spec/models/stripe_charge_spec.rb +39 -0
  143. data/spec/models/subscription_spec.rb +103 -0
  144. data/spec/spec_helper.rb +44 -0
  145. data/spec/support/factories.rb +118 -0
  146. metadata +387 -0
@@ -0,0 +1,347 @@
1
+ BLAHBLAH
2
+ BLAHBLAH
3
+  (1.1ms) CREATE TABLE "addresses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "addressable_type" varchar(255), "addressable_id" integer, "category" varchar(64), "full_name" varchar(255), "address1" varchar(255), "address2" varchar(255), "city" varchar(255), "state_code" varchar(255), "country_code" varchar(255), "postal_code" varchar(255), "updated_at" datetime, "created_at" datetime) 
4
+  (0.1ms) select sqlite_version(*)
5
+  (0.7ms) CREATE INDEX "index_addresses_on_addressable_id" ON "addresses" ("addressable_id")
6
+  (0.1ms) SELECT sql
7
+ FROM sqlite_master
8
+ WHERE name='index_addresses_on_addressable_id' AND type='index'
9
+ UNION ALL
10
+ SELECT sql
11
+ FROM sqlite_temp_master
12
+ WHERE name='index_addresses_on_addressable_id' AND type='index'
13
+
14
+  (0.8ms) CREATE INDEX "index_addresses_on_addressable_type_and_addressable_id" ON "addresses" ("addressable_type", "addressable_id")
15
+  (0.8ms) CREATE TABLE "cart_items" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "cart_id" integer, "purchasable_type" varchar(255), "purchasable_id" integer, "quantity" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
16
+  (0.9ms) CREATE INDEX "index_cart_items_on_cart_id" ON "cart_items" ("cart_id")
17
+  (0.1ms) SELECT sql
18
+ FROM sqlite_master
19
+ WHERE name='index_cart_items_on_cart_id' AND type='index'
20
+ UNION ALL
21
+ SELECT sql
22
+ FROM sqlite_temp_master
23
+ WHERE name='index_cart_items_on_cart_id' AND type='index'
24
+
25
+  (0.7ms) CREATE INDEX "index_cart_items_on_purchasable_id" ON "cart_items" ("purchasable_id")
26
+  (0.1ms) SELECT sql
27
+ FROM sqlite_master
28
+ WHERE name='index_cart_items_on_purchasable_id' AND type='index'
29
+ UNION ALL
30
+ SELECT sql
31
+ FROM sqlite_temp_master
32
+ WHERE name='index_cart_items_on_purchasable_id' AND type='index'
33
+
34
+  (0.1ms)  SELECT sql
35
+ FROM sqlite_master
36
+ WHERE name='index_cart_items_on_cart_id' AND type='index'
37
+ UNION ALL
38
+ SELECT sql
39
+ FROM sqlite_temp_master
40
+ WHERE name='index_cart_items_on_cart_id' AND type='index'
41
+ 
42
+  (0.9ms) CREATE INDEX "index_cart_items_on_purchasable_type_and_purchasable_id" ON "cart_items" ("purchasable_type", "purchasable_id")
43
+  (0.7ms) CREATE TABLE "carts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
44
+  (0.8ms) CREATE INDEX "index_carts_on_user_id" ON "carts" ("user_id")
45
+  (0.7ms) CREATE TABLE "customers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "stripe_customer_id" varchar(255), "stripe_active_card" varchar(255), "stripe_connect_access_token" varchar(255), "created_at" datetime, "updated_at" datetime) 
46
+  (0.9ms) CREATE TABLE "order_items" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "seller_id" integer, "purchasable_type" varchar(255), "purchasable_id" integer, "title" varchar(255), "quantity" integer, "price" decimal(8,2) DEFAULT 0.0, "tax_exempt" boolean, "tax_rate" decimal(5,3) DEFAULT 0.0, "quickbooks_item_name" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
47
+  (0.9ms) CREATE INDEX "index_order_items_on_order_id" ON "order_items" ("order_id")
48
+  (0.1ms) SELECT sql
49
+ FROM sqlite_master
50
+ WHERE name='index_order_items_on_order_id' AND type='index'
51
+ UNION ALL
52
+ SELECT sql
53
+ FROM sqlite_temp_master
54
+ WHERE name='index_order_items_on_order_id' AND type='index'
55
+
56
+  (0.9ms) CREATE INDEX "index_order_items_on_purchasable_id" ON "order_items" ("purchasable_id")
57
+  (0.2ms) SELECT sql
58
+ FROM sqlite_master
59
+ WHERE name='index_order_items_on_purchasable_id' AND type='index'
60
+ UNION ALL
61
+ SELECT sql
62
+ FROM sqlite_temp_master
63
+ WHERE name='index_order_items_on_purchasable_id' AND type='index'
64
+
65
+  (0.1ms)  SELECT sql
66
+ FROM sqlite_master
67
+ WHERE name='index_order_items_on_order_id' AND type='index'
68
+ UNION ALL
69
+ SELECT sql
70
+ FROM sqlite_temp_master
71
+ WHERE name='index_order_items_on_order_id' AND type='index'
72
+ 
73
+  (0.7ms) CREATE INDEX "index_order_items_on_purchasable_type_and_purchasable_id" ON "order_items" ("purchasable_type", "purchasable_id")
74
+  (0.9ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "purchase_state" varchar(255), "purchased_at" datetime, "payment" text, "details" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
75
+  (1.0ms) CREATE INDEX "index_orders_on_user_id" ON "orders" ("user_id")
76
+  (0.7ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "price" decimal(8,2) DEFAULT 0.0, "tax_exempt" boolean, "quickbooks_item_name" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
77
+  (0.9ms) CREATE TABLE "subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "customer_id" integer, "stripe_plan_id" varchar(255), "stripe_subscription_id" varchar(255), "stripe_coupon_id" varchar(255), "title" varchar(255), "price" decimal(8,2) DEFAULT 0.0, "created_at" datetime, "updated_at" datetime)
78
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "encrypted_password" varchar(255), "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "confirmation_sent_at" datetime, "confirmed_at" datetime, "confirmation_token" varchar(255), "unconfirmed_email" varchar(255), "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "email" varchar(255), "roles_mask" integer DEFAULT 0, "archived" boolean DEFAULT 'f', "updated_at" datetime, "created_at" datetime) 
79
+  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
80
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
81
+  (0.1ms) SELECT version FROM "schema_migrations"
82
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('4')
83
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
84
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
85
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
86
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
87
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
88
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
89
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
90
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
91
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
92
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
93
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
94
+  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
95
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
96
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
97
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
98
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
99
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
100
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
101
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
102
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
103
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
104
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
105
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
106
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
107
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
108
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
109
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
110
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
111
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
112
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
113
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
114
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
115
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
116
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
117
+  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
118
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
119
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
120
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
121
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
122
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
123
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
124
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
125
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
126
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
127
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
128
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
129
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
130
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
131
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
132
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
133
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
134
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
135
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
136
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
137
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
138
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
139
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
140
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
141
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
142
+  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
143
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
144
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
145
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
146
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
147
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
148
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
149
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
150
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
151
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
152
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
153
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
154
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
155
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
156
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
157
+  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
158
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
159
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
160
+  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
161
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
162
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
163
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
164
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
165
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
166
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
167
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
168
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
169
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
170
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
171
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
172
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
173
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
174
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
175
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
176
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
177
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
178
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
179
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
180
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
181
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
182
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
183
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
184
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
185
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
186
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
187
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
188
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
189
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
190
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
191
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
192
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
193
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
194
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
195
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
196
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
197
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
198
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
199
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
200
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
201
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
202
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
203
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
204
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
205
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
206
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
207
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
208
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
209
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
210
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
211
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
212
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
213
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
214
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
215
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
216
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
217
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
218
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
219
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
220
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
221
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
222
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
223
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
224
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
225
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
226
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
227
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
228
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
229
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
230
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
231
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
232
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
233
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
234
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
235
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
236
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
237
+  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
238
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
239
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
240
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
241
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
242
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
243
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
244
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
245
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
246
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
247
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
248
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
249
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
250
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
251
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
252
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
253
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
254
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
255
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
256
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
257
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
258
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
259
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
260
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
261
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
262
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
263
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
264
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
265
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
266
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
267
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
268
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
269
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
270
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
271
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
272
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
273
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
274
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
275
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
276
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
277
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
278
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
279
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
280
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
281
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
282
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
283
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
284
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
285
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
286
+  (0.4ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
287
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
288
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
289
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
290
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
291
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
292
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
293
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
294
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
295
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
296
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
297
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
298
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
299
+  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
300
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
301
+  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
302
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
303
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
304
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
305
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
306
+  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
307
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
308
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
309
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
310
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
311
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
312
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
313
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
314
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
315
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
316
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
317
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
318
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
319
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
320
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
321
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
322
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
323
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
324
+  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
325
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
326
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
327
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
328
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
329
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
330
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
331
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
332
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
333
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
334
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
335
+  (0.6ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
336
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
337
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
338
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
339
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
340
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
341
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
342
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
343
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
344
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
345
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
346
+  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
347
+  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
@@ -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,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe EffectiveOrdersHelper do
4
+ describe '#price_to_currency' do
5
+ it 'converts an integer number of cents to a currency formatted string' do
6
+ price_to_currency(1050).should eq '$10.50'
7
+ price_to_currency(10050).should eq '$100.50'
8
+ price_to_currency(1).should eq '$0.01'
9
+ price_to_currency(99).should eq '$0.99'
10
+ price_to_currency(0).should eq '$0.00'
11
+ end
12
+
13
+ it 'raises an error when passed a decimal' do
14
+ expect { price_to_currency(10.00) }.to raise_exception
15
+ end
16
+
17
+ it 'raises an error when passed nil' do
18
+ expect { price_to_currency(nil) }.to raise_exception
19
+ end
20
+ end
21
+ end