spree 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of spree might be problematic. Click here for more details.

Files changed (211) hide show
  1. data/History.txt +5 -0
  2. data/Manifest.txt +158 -21
  3. data/config/hoe.rb +2 -1
  4. data/lib/spree/version.rb +1 -1
  5. data/starter-app/app/views/layouts/application.rhtml +6 -4
  6. data/starter-app/db/sample/line_items.yml +6 -4
  7. data/starter-app/db/sample/{variations.yml → variants.yml} +16 -0
  8. data/starter-app/log/README +1 -0
  9. data/starter-app/public/images/spree.jpg +0 -0
  10. data/starter-app/public/stylesheets/application.css +2 -2
  11. data/starter-app/script/spec +4 -0
  12. data/starter-app/script/spec_server +102 -0
  13. data/starter-app/spec/models/cart_item_spec.rb +50 -0
  14. data/starter-app/spec/models/cart_spec.rb +51 -0
  15. data/starter-app/spec/models/line_item_spec.rb +33 -0
  16. data/starter-app/spec/models/product_spec.rb +29 -0
  17. data/starter-app/spec/rcov.opts +2 -0
  18. data/starter-app/spec/spec.opts +6 -0
  19. data/starter-app/spec/spec_helper.rb +39 -0
  20. data/starter-app/stories/all.rb +4 -0
  21. data/starter-app/stories/helper.rb +3 -0
  22. data/starter-app/vendor/plugins/rspec_on_rails/MIT-LICENSE +31 -0
  23. data/starter-app/vendor/plugins/rspec_on_rails/README +3 -0
  24. data/starter-app/vendor/plugins/rspec_on_rails/Rakefile +9 -0
  25. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec/CHANGES +1 -0
  26. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec/rspec_generator.rb +35 -0
  27. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec/templates/all_stories.rb +4 -0
  28. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec/templates/previous_failures.txt +0 -0
  29. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec/templates/rcov.opts +2 -0
  30. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec/templates/script/spec +4 -0
  31. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec/templates/script/spec_server +102 -0
  32. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec/templates/spec.opts +6 -0
  33. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec/templates/spec_helper.rb +39 -0
  34. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec/templates/stories_helper.rb +3 -0
  35. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec_controller/USAGE +33 -0
  36. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec_controller/rspec_controller_generator.rb +49 -0
  37. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/controller_spec.rb +25 -0
  38. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/helper_spec.rb +11 -0
  39. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/view_spec.rb +12 -0
  40. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec_model/USAGE +18 -0
  41. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec_model/rspec_model_generator.rb +30 -0
  42. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec_model/templates/model_spec.rb +11 -0
  43. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/rspec_scaffold_generator.rb +167 -0
  44. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/controller_spec.rb +313 -0
  45. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/edit_erb_spec.rb +25 -0
  46. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/helper_spec.rb +11 -0
  47. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/index_erb_spec.rb +22 -0
  48. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/new_erb_spec.rb +26 -0
  49. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/routing_spec.rb +61 -0
  50. data/starter-app/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb +22 -0
  51. data/starter-app/vendor/plugins/rspec_on_rails/init.rb +9 -0
  52. data/starter-app/vendor/plugins/rspec_on_rails/lib/autotest/discover.rb +1 -0
  53. data/starter-app/vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb +81 -0
  54. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails.rb +51 -0
  55. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/example.rb +47 -0
  56. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/example/assigns_hash_proxy.rb +42 -0
  57. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb +255 -0
  58. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/example/functional_example_group.rb +66 -0
  59. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/example/helper_example_group.rb +82 -0
  60. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/example/ivar_proxy.rb +62 -0
  61. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/example/model_example_group.rb +14 -0
  62. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/example/rails_example_group.rb +68 -0
  63. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/example/render_observer.rb +90 -0
  64. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/example/view_example_group.rb +171 -0
  65. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions.rb +12 -0
  66. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/base.rb +14 -0
  67. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/rescue.rb +21 -0
  68. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/test_response.rb +11 -0
  69. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_view/base.rb +27 -0
  70. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/active_record/base.rb +30 -0
  71. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/object.rb +5 -0
  72. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/example/configuration.rb +66 -0
  73. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb +21 -0
  74. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers.rb +29 -0
  75. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/assert_select.rb +130 -0
  76. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb +55 -0
  77. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/redirect_to.rb +113 -0
  78. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/render_template.rb +70 -0
  79. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/story_adapter.rb +71 -0
  80. data/starter-app/vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb +23 -0
  81. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/autotest/mappings_spec.rb +36 -0
  82. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/autotest/rails_rspec_spec.rb +8 -0
  83. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/example/assigns_hash_proxy_spec.rb +55 -0
  84. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/example/configuration_spec.rb +83 -0
  85. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb +43 -0
  86. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/example/controller_spec_spec.rb +187 -0
  87. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/example/example_group_factory_spec.rb +112 -0
  88. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/example/helper_spec_spec.rb +118 -0
  89. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/example/ivar_proxy_spec.rb +64 -0
  90. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/example/model_spec_spec.rb +18 -0
  91. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/example/shared_behaviour_spec.rb +16 -0
  92. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/example/test_unit_assertion_accessibility_spec.rb +33 -0
  93. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/example/view_spec_spec.rb +263 -0
  94. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/extensions/action_controller_rescue_action_spec.rb +54 -0
  95. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/extensions/action_view_base_spec.rb +48 -0
  96. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/extensions/active_record_spec.rb +14 -0
  97. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/matchers/assert_select_spec.rb +783 -0
  98. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/matchers/description_generation_spec.rb +37 -0
  99. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/matchers/errors_on_spec.rb +13 -0
  100. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/matchers/have_text_spec.rb +62 -0
  101. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/matchers/redirect_to_spec.rb +203 -0
  102. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/matchers/render_spec.rb +169 -0
  103. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/mocks/mock_model_spec.rb +65 -0
  104. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/sample_spec.rb +7 -0
  105. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/spec_server_spec.rb +89 -0
  106. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails/spec_spec.rb +11 -0
  107. data/starter-app/vendor/plugins/rspec_on_rails/spec/rails_suite.rb +7 -0
  108. data/starter-app/vendor/plugins/rspec_on_rails/spec/spec_helper.rb +46 -0
  109. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/controllers/action_view_base_spec_controller.rb +2 -0
  110. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/controllers/controller_spec_controller.rb +56 -0
  111. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/controllers/redirect_spec_controller.rb +59 -0
  112. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/controllers/render_spec_controller.rb +26 -0
  113. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/controllers/rjs_spec_controller.rb +58 -0
  114. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/helpers/explicit_helper.rb +10 -0
  115. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/helpers/more_explicit_helper.rb +5 -0
  116. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/helpers/plugin_application_helper.rb +6 -0
  117. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/helpers/view_spec_helper.rb +13 -0
  118. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/_partial.rhtml +0 -0
  119. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_setting_flash_after_session_reset.rhtml +1 -0
  120. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_setting_flash_before_session_reset.rhtml +1 -0
  121. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_setting_the_assigns_hash.rhtml +0 -0
  122. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_with_errors_in_template.rhtml +1 -0
  123. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_with_template.rhtml +1 -0
  124. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/_a_partial.rhtml +0 -0
  125. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/some_action.js.rjs +1 -0
  126. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/some_action.rhtml +0 -0
  127. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/some_action.rjs +1 -0
  128. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/_replacement_partial.rhtml +1 -0
  129. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/hide_div.rjs +1 -0
  130. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/hide_page_element.rjs +1 -0
  131. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/insert_html.rjs +1 -0
  132. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace.rjs +1 -0
  133. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace_html.rjs +1 -0
  134. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace_html_with_partial.rjs +1 -0
  135. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/visual_effect.rjs +1 -0
  136. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/visual_toggle_effect.rjs +1 -0
  137. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/no_tags.rhtml +1 -0
  138. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/single_div_with_no_attributes.rhtml +1 -0
  139. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/single_div_with_one_attribute.rhtml +1 -0
  140. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial.rhtml +2 -0
  141. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial_used_twice.rhtml +0 -0
  142. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial_with_local_variable.rhtml +1 -0
  143. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial_with_sub_partial.rhtml +1 -0
  144. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_spacer.rhtml +1 -0
  145. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/accessor.rhtml +3 -0
  146. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/entry_form.rhtml +2 -0
  147. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/explicit_helper.rhtml +2 -0
  148. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/foo/show.rhtml +1 -0
  149. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/implicit_helper.rhtml +2 -0
  150. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/multiple_helpers.rhtml +3 -0
  151. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial.rhtml +5 -0
  152. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial_using_collection.rhtml +3 -0
  153. data/starter-app/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial_with_array.rhtml +1 -0
  154. data/starter-app/vendor/plugins/rspec_on_rails/stories/all.rb +10 -0
  155. data/starter-app/vendor/plugins/rspec_on_rails/stories/helper.rb +5 -0
  156. data/starter-app/vendor/plugins/rspec_on_rails/stories/steps/people.rb +8 -0
  157. data/starter-app/vendor/plugins/rspec_on_rails/stories/transactions_should_rollback +15 -0
  158. data/starter-app/vendor/plugins/rspec_on_rails/stories/transactions_should_rollback.rb +25 -0
  159. data/starter-app/vendor/plugins/rspec_on_rails/tasks/rspec.rake +137 -0
  160. data/starter-app/vendor/plugins/spree/LICENSE +1 -1
  161. data/starter-app/vendor/plugins/spree/app/controllers/admin/categories_controller.rb +0 -24
  162. data/starter-app/vendor/plugins/spree/app/controllers/admin/products_controller.rb +16 -16
  163. data/starter-app/vendor/plugins/spree/app/controllers/cart_controller.rb +2 -8
  164. data/starter-app/vendor/plugins/spree/app/helpers/admin/products_helper.rb +1 -1
  165. data/starter-app/vendor/plugins/spree/app/helpers/spree/base_helper.rb +2 -2
  166. data/starter-app/vendor/plugins/spree/app/models/cart.rb +7 -20
  167. data/starter-app/vendor/plugins/spree/app/models/cart_item.rb +3 -6
  168. data/starter-app/vendor/plugins/spree/app/models/category.rb +6 -22
  169. data/starter-app/vendor/plugins/spree/app/models/line_item.rb +3 -5
  170. data/starter-app/vendor/plugins/spree/app/models/option_value.rb +1 -1
  171. data/starter-app/vendor/plugins/spree/app/models/product.rb +18 -2
  172. data/starter-app/vendor/plugins/spree/app/models/variant.rb +5 -0
  173. data/starter-app/vendor/plugins/spree/app/views/admin/categories/_form.rhtml +1 -5
  174. data/starter-app/vendor/plugins/spree/app/views/admin/overview/index.rhtml +3 -0
  175. data/starter-app/vendor/plugins/spree/app/views/admin/products/_form.rhtml +2 -2
  176. data/starter-app/vendor/plugins/spree/app/views/admin/products/{_new_variation.rhtml → _new_variant.rhtml} +1 -1
  177. data/starter-app/vendor/plugins/spree/app/views/admin/products/_variants.rhtml +43 -0
  178. data/starter-app/vendor/plugins/spree/app/views/cart/index.rhtml +4 -4
  179. data/starter-app/vendor/plugins/spree/app/views/layouts/admin.rhtml +1 -1
  180. data/starter-app/vendor/plugins/spree/app/views/order_mailer/cancel.rhtml +1 -1
  181. data/starter-app/vendor/plugins/spree/app/views/order_mailer/confirm.rhtml +1 -1
  182. data/starter-app/vendor/plugins/spree/app/views/shared/_order_details.rhtml +1 -1
  183. data/starter-app/vendor/plugins/spree/app/views/store/show.rhtml +30 -29
  184. data/starter-app/vendor/plugins/spree/assets/images/spree/spree.jpg +0 -0
  185. data/starter-app/vendor/plugins/spree/assets/stylesheets/spree-admin.css +1 -1
  186. data/starter-app/vendor/plugins/spree/assets/stylesheets/store/_controller.css +1 -1
  187. data/starter-app/vendor/plugins/spree/db/migrate/002_create_cart_items.rb +1 -2
  188. data/starter-app/vendor/plugins/spree/db/migrate/006_create_line_items.rb +5 -7
  189. data/starter-app/vendor/plugins/spree/db/migrate/011_create_variants.rb +11 -0
  190. data/starter-app/vendor/plugins/spree/db/migrate/018_create_option_values_variants.rb +12 -0
  191. data/starter-app/vendor/plugins/spree/test/unit/product_test.rb +0 -33
  192. metadata +170 -23
  193. data/starter-app/vendor/plugins/spree/app/controllers/admin/variations_controller.rb +0 -73
  194. data/starter-app/vendor/plugins/spree/app/helpers/admin/variations_helper.rb +0 -2
  195. data/starter-app/vendor/plugins/spree/app/models/variation.rb +0 -8
  196. data/starter-app/vendor/plugins/spree/app/views/admin/option_types/test.rhtml +0 -8
  197. data/starter-app/vendor/plugins/spree/app/views/admin/products/_variations.rhtml +0 -41
  198. data/starter-app/vendor/plugins/spree/app/views/admin/variations/_form.rhtml +0 -33
  199. data/starter-app/vendor/plugins/spree/app/views/admin/variations/_option_values.rhtml +0 -5
  200. data/starter-app/vendor/plugins/spree/app/views/admin/variations/list.rhtml +0 -23
  201. data/starter-app/vendor/plugins/spree/app/views/admin/variations/new.rhtml +0 -14
  202. data/starter-app/vendor/plugins/spree/assets/images/spree/spree_logo142x65.gif +0 -0
  203. data/starter-app/vendor/plugins/spree/assets/images/spree/spree_logo245x112.gif +0 -0
  204. data/starter-app/vendor/plugins/spree/db/migrate/011_create_variations.rb +0 -11
  205. data/starter-app/vendor/plugins/spree/db/migrate/018_create_option_values_variations.rb +0 -12
  206. data/starter-app/vendor/plugins/spree/test/functional/admin/variations_controller_test.rb +0 -18
  207. data/starter-app/vendor/plugins/spree/test/integration/variations_test.rb +0 -24
  208. data/starter-app/vendor/plugins/spree/test/unit/cart_item_test.rb +0 -55
  209. data/starter-app/vendor/plugins/spree/test/unit/cart_test.rb +0 -35
  210. data/starter-app/vendor/plugins/spree/test/unit/line_item_test.rb +0 -61
  211. data/starter-app/vendor/plugins/spree/test/unit/variation_test.rb +0 -9
@@ -0,0 +1,5 @@
1
+ module MoreExplicitHelper
2
+ def method_in_more_explicit_helper
3
+ "<div>This is text from a method in the MoreExplicitHelper</div>"
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ # Methods added to this helper will be available to all templates in the application.
2
+ module ApplicationHelper
3
+ def method_in_plugin_application_helper
4
+ "<div>This is text from a method in the ApplicationHelper</div>"
5
+ end
6
+ end
@@ -0,0 +1,13 @@
1
+ module ViewSpecHelper
2
+ def method_in_helper
3
+ "<div>This is text from a method in the ViewSpecHelper</div>"
4
+ end
5
+
6
+ def method_in_template_with_partial
7
+ "<div>method_in_template_with_partial in ViewSpecHelper</div>"
8
+ end
9
+
10
+ def method_in_partial
11
+ "<div>method_in_partial in ViewSpecHelper</div>"
12
+ end
13
+ end
@@ -0,0 +1 @@
1
+ page.insert_html 'mydiv', 'replacement text'
@@ -0,0 +1 @@
1
+ page.replace 'mydiv', 'replacement text'
@@ -0,0 +1 @@
1
+ page.replace_html 'mydiv', 'replacement text'
@@ -0,0 +1 @@
1
+ page.replace_html 'mydiv', :partial => 'rjs_spec/replacement_partial'
@@ -0,0 +1,2 @@
1
+ <%= method_in_plugin_application_helper %>
2
+ <%= method_in_partial %>
@@ -0,0 +1 @@
1
+ <%= render :partial => 'partial', :object => partial %>
@@ -0,0 +1,3 @@
1
+ <div id="session"><%= session[:key] %></div>
2
+ <div id="params"><%= params[:key] %></div>
3
+ <div id="flash"><%= flash[:key] %></div>
@@ -0,0 +1,2 @@
1
+ <%= method_in_plugin_application_helper %>
2
+ <%= method_in_explicit_helper %>
@@ -0,0 +1 @@
1
+ <%= method_in_plugin_application_helper %>
@@ -0,0 +1,2 @@
1
+ <%= method_in_plugin_application_helper %>
2
+ <%= method_in_helper %>
@@ -0,0 +1,3 @@
1
+ <%= method_in_plugin_application_helper %>
2
+ <%= method_in_explicit_helper %>
3
+ <%= method_in_more_explicit_helper %>
@@ -0,0 +1,5 @@
1
+ <%= method_in_template_with_partial %>
2
+ <%= render :partial => 'partial' %>
3
+
4
+ <%= render :partial => 'partial_used_twice' %>
5
+ <%= render :partial => 'partial_used_twice' %>
@@ -0,0 +1,3 @@
1
+ <%= render :partial => 'partial',
2
+ :collection => ['Alice', 'Bob'],
3
+ :spacer_template => 'spacer' %>
@@ -0,0 +1,10 @@
1
+ require File.join(File.dirname(__FILE__), *%w[helper])
2
+ require File.join(File.dirname(__FILE__), *%w[steps people])
3
+
4
+ # Run transactions_should_rollback in Ruby
5
+ require File.join(File.dirname(__FILE__), *%w[transactions_should_rollback])
6
+
7
+ # Run transactions_should_rollback in Plain Text
8
+ with_steps_for :people do
9
+ run File.join(File.dirname(__FILE__), *%w[transactions_should_rollback]), :type => RailsStory
10
+ end
@@ -0,0 +1,5 @@
1
+ dir = File.dirname(__FILE__)
2
+ $LOAD_PATH.unshift File.expand_path("#{dir}/../lib")
3
+ require File.expand_path("#{dir}/../../../../spec/spec_helper")
4
+
5
+ require 'spec/rails/story_adapter'
@@ -0,0 +1,8 @@
1
+ steps_for :people do
2
+ When "I add a Person" do
3
+ Person.create!(:name => "Foo")
4
+ end
5
+ Then "there should be one person" do
6
+ Person.count.should == 1
7
+ end
8
+ end
@@ -0,0 +1,15 @@
1
+ Story: transactions should rollback in plain text
2
+ As an RSpec/Rails Story author
3
+ I want transactions to roll back between scenarios in plain text
4
+ So that I can have confidence in the state of the database
5
+
6
+ Scenario: add one Person
7
+ When I add a Person
8
+
9
+ Scenario: add another person
10
+ GivenScenario: add one Person
11
+ Then there should be one person
12
+
13
+ Scenario: add yet another person
14
+ GivenScenario: add one Person
15
+ Then there should be one person
@@ -0,0 +1,25 @@
1
+ require File.join(File.dirname(__FILE__), *%w[helper])
2
+
3
+ Story "transactions should rollback", %{
4
+ As an RSpec/Rails Story author
5
+ I want transactions to roll back between scenarios
6
+ So that I can have confidence in the state of the database
7
+ }, :type => RailsStory do
8
+ Scenario "add one Person" do
9
+ When "I add a Person" do
10
+ Person.create!(:name => "Foo")
11
+ end
12
+ end
13
+
14
+ Scenario "add another person" do
15
+ GivenScenario "add one Person"
16
+ Then "there should be one person" do
17
+ Person.count.should == 1
18
+ end
19
+ end
20
+
21
+ Scenario "add yet another person" do
22
+ GivenScenario "add one Person"
23
+ Then "there should be one person"
24
+ end
25
+ end
@@ -0,0 +1,137 @@
1
+ # In rails 1.2, plugins aren't available in the path until they're loaded.
2
+ # Check to see if the rspec plugin is installed first and require
3
+ # it if it is. If not, use the gem version.
4
+ rspec_base = File.expand_path(File.dirname(__FILE__) + '/../../rspec/lib')
5
+ $LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
6
+ require 'spec/rake/spectask'
7
+ require 'spec/translator'
8
+
9
+ spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? "db:test:prepare" : :noop
10
+ task :noop do
11
+ end
12
+
13
+ task :default => :spec
14
+ task :stats => "spec:statsetup"
15
+
16
+ desc "Run all specs in spec directory (excluding plugin specs)"
17
+ Spec::Rake::SpecTask.new(:spec => spec_prereq) do |t|
18
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
19
+ t.spec_files = FileList['spec/**/*_spec.rb']
20
+ end
21
+
22
+ namespace :spec do
23
+ desc "Run all specs in spec directory with RCov (excluding plugin specs)"
24
+ Spec::Rake::SpecTask.new(:rcov) do |t|
25
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
26
+ t.spec_files = FileList['spec/**/*_spec.rb']
27
+ t.rcov = true
28
+ t.rcov_opts = lambda do
29
+ IO.readlines("#{RAILS_ROOT}/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
30
+ end
31
+ end
32
+
33
+ desc "Print Specdoc for all specs (excluding plugin specs)"
34
+ Spec::Rake::SpecTask.new(:doc) do |t|
35
+ t.spec_opts = ["--format", "specdoc", "--dry-run"]
36
+ t.spec_files = FileList['spec/**/*_spec.rb']
37
+ end
38
+
39
+ desc "Print Specdoc for all plugin specs"
40
+ Spec::Rake::SpecTask.new(:plugin_doc) do |t|
41
+ t.spec_opts = ["--format", "specdoc", "--dry-run"]
42
+ t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*')
43
+ end
44
+
45
+ [:models, :controllers, :views, :helpers, :lib].each do |sub|
46
+ desc "Run the specs under spec/#{sub}"
47
+ Spec::Rake::SpecTask.new(sub => spec_prereq) do |t|
48
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
49
+ t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
50
+ end
51
+ end
52
+
53
+ desc "Run the specs under vendor/plugins (except RSpec's own)"
54
+ Spec::Rake::SpecTask.new(:plugins => spec_prereq) do |t|
55
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
56
+ t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*').exclude("vendor/plugins/rspec_on_rails/*")
57
+ end
58
+
59
+ namespace :plugins do
60
+ desc "Runs the examples for rspec_on_rails"
61
+ Spec::Rake::SpecTask.new(:rspec_on_rails) do |t|
62
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
63
+ t.spec_files = FileList['vendor/plugins/rspec_on_rails/spec/**/*_spec.rb']
64
+ end
65
+ end
66
+
67
+ desc "Translate/upgrade specs using the built-in translator"
68
+ task :translate do
69
+ translator = ::Spec::Translator.new
70
+ dir = RAILS_ROOT + '/spec'
71
+ translator.translate(dir, dir)
72
+ end
73
+
74
+ # Setup specs for stats
75
+ task :statsetup do
76
+ require 'code_statistics'
77
+ ::STATS_DIRECTORIES << %w(Model\ specs spec/models) if File.exist?('spec/models')
78
+ ::STATS_DIRECTORIES << %w(View\ specs spec/views) if File.exist?('spec/views')
79
+ ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers')
80
+ ::STATS_DIRECTORIES << %w(Helper\ specs spec/helpers) if File.exist?('spec/helpers')
81
+ ::STATS_DIRECTORIES << %w(Library\ specs spec/lib) if File.exist?('spec/lib')
82
+ ::CodeStatistics::TEST_TYPES << "Model specs" if File.exist?('spec/models')
83
+ ::CodeStatistics::TEST_TYPES << "View specs" if File.exist?('spec/views')
84
+ ::CodeStatistics::TEST_TYPES << "Controller specs" if File.exist?('spec/controllers')
85
+ ::CodeStatistics::TEST_TYPES << "Helper specs" if File.exist?('spec/helpers')
86
+ ::CodeStatistics::TEST_TYPES << "Library specs" if File.exist?('spec/lib')
87
+ ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
88
+ end
89
+
90
+ namespace :db do
91
+ namespace :fixtures do
92
+ desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y"
93
+ task :load => :environment do
94
+ require 'active_record/fixtures'
95
+ ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
96
+ (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
97
+ Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
98
+ end
99
+ end
100
+ end
101
+ end
102
+
103
+ namespace :server do
104
+ daemonized_server_pid = File.expand_path("spec_server.pid", RAILS_ROOT + "/tmp")
105
+
106
+ desc "start spec_server."
107
+ task :start do
108
+ if File.exist?(daemonized_server_pid)
109
+ $stderr.puts "spec_server is already running."
110
+ else
111
+ $stderr.puts "Starting up spec server."
112
+ system("ruby", "script/spec_server", "--daemon", "--pid", daemonized_server_pid)
113
+ end
114
+ end
115
+
116
+ desc "stop spec_server."
117
+ task :stop do
118
+ unless File.exist?(daemonized_server_pid)
119
+ $stderr.puts "No server running."
120
+ else
121
+ $stderr.puts "Shutting down spec_server."
122
+ system("kill", "-s", "TERM", File.read(daemonized_server_pid).strip) &&
123
+ File.delete(daemonized_server_pid)
124
+ end
125
+ end
126
+
127
+ desc "reload spec_server."
128
+ task :restart do
129
+ unless File.exist?(daemonized_server_pid)
130
+ $stderr.puts "No server running."
131
+ else
132
+ $stderr.puts "Reloading down spec_server."
133
+ system("kill", "-s", "USR2", File.read(daemonized_server_pid).strip)
134
+ end
135
+ end
136
+ end
137
+ end
@@ -1,4 +1,4 @@
1
- Copyright (c) 2007, Schofield Tech Works LLC
1
+ Copyright (c) 2007-2008, Schofield Tech Works LLC and other contributors
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification,
@@ -39,16 +39,6 @@ class Admin::CategoriesController < Admin::BaseController
39
39
  # clear out previous tax treatments since deselecting them will not communicated via POST
40
40
  @category.tax_treatments.clear
41
41
  @category.tax_treatments = TaxTreatment.find(params[:tax_treatments]) if params[:tax_treatments]
42
-
43
- #if params[:variation]
44
- # @variation = Variation.new(params[:variation])
45
- # unless @variation.valid?
46
- # flash[:error] = "Problem saving variation"
47
- # redirect_to :action => "edit", :id => @category and return
48
- # end
49
-
50
- # @category.variations << @variation if @variation
51
- #end
52
42
  @category.save
53
43
 
54
44
  if @category.update_attributes(params[:category])
@@ -82,20 +72,6 @@ class Admin::CategoriesController < Admin::BaseController
82
72
  :layout => false
83
73
  end
84
74
 
85
- # AJAX method to show variations based on change in parent category
86
- def category_variations
87
- category = Category.find_or_create_by_id(params[:category_id])
88
- if params[:parent_id].blank?
89
- category.parent = nil
90
- else
91
- category.parent = Category.find(params[:parent_id])
92
- end
93
-
94
- render :partial => 'shared/variations',
95
- :locals => {:variations => category.variations, :category => category},
96
- :layout => false
97
- end
98
-
99
75
  private
100
76
 
101
77
  def load_data
@@ -70,13 +70,13 @@ class Admin::ProductsController < Admin::BaseController
70
70
  @product.sku.number = params[:sku][:number]
71
71
  @product.sku.save
72
72
 
73
- if params[:variation]
74
- @variation = Variation.new(params[:variation])
75
- unless @variation.valid?
76
- flash[:error] = "Problem saving variation"
73
+ if params[:variant]
74
+ @variant = Variant.new(params[:variant])
75
+ unless @variant.valid?
76
+ flash[:error] = "Problem saving variant"
77
77
  redirect_to :action => "edit", :id => @product and return
78
78
  end
79
- @product.variations << @variation if @variation
79
+ @product.variants << @variant if @variant
80
80
  end
81
81
 
82
82
  # need to clear this every time in case user removes tags (those won't show up in the post)
@@ -91,13 +91,13 @@ class Admin::ProductsController < Admin::BaseController
91
91
  end
92
92
  end
93
93
 
94
- if params[:new_variation]
95
- v = Variation.new
96
- params[:new_variation].each do |key, value|
94
+ if params[:new_variant]
95
+ v = Variant.new
96
+ params[:new_variant].each do |key, value|
97
97
  v.option_values << OptionValue.find(value)
98
98
  end
99
99
  v.save
100
- @product.variations << v
100
+ @product.variants << v
101
101
  @product.save
102
102
  end
103
103
 
@@ -164,20 +164,20 @@ class Admin::ProductsController < Admin::BaseController
164
164
  end
165
165
 
166
166
  #AJAX method
167
- def new_variation
167
+ def new_variant
168
168
  @product = Product.find(params[:id])
169
- @variation = Variation.new
170
- render :partial => 'new_variation',
169
+ @variant = Variant.new
170
+ render :partial => 'new_variant',
171
171
  :locals => {:product => @product},
172
172
  :layout => false
173
173
  end
174
174
 
175
175
  #AJAX method
176
- def delete_variation
176
+ def delete_variant
177
177
  @product = Product.find(params[:id])
178
- Variation.destroy(params[:variation_id])
179
- flash.now[:notice] = 'Variation successfully removed.'
180
- render :partial => 'variations',
178
+ Variant.destroy(params[:variant_id])
179
+ flash.now[:notice] = 'Variant successfully removed.'
180
+ render :partial => 'variants',
181
181
  :locals => {:product => @product},
182
182
  :layout => false
183
183
  end