rspec-rails 1.1.11 → 1.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. data/History.txt +29 -0
  2. data/Manifest.txt +94 -94
  3. data/README.txt +5 -7
  4. data/Rakefile +14 -2
  5. data/{spec_resources/views/controller_spec/_partial.rhtml → TODO.txt} +0 -0
  6. data/features/step_definitions/people.rb +6 -0
  7. data/features/support/env.rb +13 -0
  8. data/{stories/transactions_should_rollback → features/transactions/transactions_should_rollback.feature} +4 -3
  9. data/generators/rspec/rspec_generator.rb +0 -4
  10. data/generators/rspec/templates/rspec.rake +130 -104
  11. data/generators/rspec/templates/script/spec_server +17 -8
  12. data/generators/rspec/templates/spec_helper.rb +1 -1
  13. data/generators/rspec_default_values.rb +3 -3
  14. data/generators/rspec_scaffold/templates/edit_erb_spec.rb +7 -6
  15. data/generators/rspec_scaffold/templates/index_erb_spec.rb +9 -8
  16. data/generators/rspec_scaffold/templates/new_erb_spec.rb +7 -6
  17. data/generators/rspec_scaffold/templates/show_erb_spec.rb +9 -9
  18. data/lib/spec/rails.rb +14 -2
  19. data/lib/spec/rails/example/controller_example_group.rb +16 -23
  20. data/lib/spec/rails/example/cookies_proxy.rb +5 -1
  21. data/lib/spec/rails/example/functional_example_group.rb +17 -5
  22. data/lib/spec/rails/example/helper_example_group.rb +5 -4
  23. data/lib/spec/rails/example/rails_example_group.rb +10 -15
  24. data/lib/spec/rails/example/view_example_group.rb +5 -5
  25. data/lib/spec/rails/extensions.rb +1 -3
  26. data/lib/spec/rails/extensions/action_controller/base.rb +1 -1
  27. data/lib/spec/rails/extensions/action_controller/rescue.rb +9 -5
  28. data/lib/spec/rails/extensions/action_controller/test_response.rb +11 -2
  29. data/lib/spec/rails/extensions/action_view/base.rb +4 -2
  30. data/lib/spec/rails/extensions/active_record/base.rb +1 -2
  31. data/lib/spec/rails/extensions/spec/{example → runner}/configuration.rb +12 -7
  32. data/lib/spec/rails/matchers.rb +1 -0
  33. data/lib/spec/rails/matchers/ar_be_valid.rb +41 -0
  34. data/lib/spec/rails/matchers/redirect_to.rb +4 -2
  35. data/lib/spec/rails/matchers/render_template.rb +30 -10
  36. data/lib/spec/rails/mocks.rb +11 -8
  37. data/lib/spec/rails/version.rb +3 -2
  38. data/rspec-rails.gemspec +16 -8
  39. data/spec/{rails/autotest → autotest}/mappings_spec.rb +3 -3
  40. data/{spec_resources → spec/resources}/controllers/action_view_base_spec_controller.rb +0 -0
  41. data/spec/resources/controllers/application.rb +9 -0
  42. data/{spec_resources → spec/resources}/controllers/controller_spec_controller.rb +19 -6
  43. data/{spec_resources → spec/resources}/controllers/redirect_spec_controller.rb +7 -0
  44. data/{spec_resources → spec/resources}/controllers/render_spec_controller.rb +0 -0
  45. data/{spec_resources → spec/resources}/controllers/rjs_spec_controller.rb +0 -0
  46. data/{spec_resources → spec/resources}/helpers/addition_helper.rb +0 -0
  47. data/{spec_resources → spec/resources}/helpers/explicit_helper.rb +8 -0
  48. data/{spec_resources → spec/resources}/helpers/more_explicit_helper.rb +0 -0
  49. data/{spec_resources → spec/resources}/helpers/plugin_application_helper.rb +0 -0
  50. data/{spec_resources → spec/resources}/helpers/view_spec_helper.rb +0 -0
  51. data/spec/resources/models/animal.rb +4 -0
  52. data/spec/resources/models/person.rb +18 -0
  53. data/spec/resources/models/thing.rb +3 -0
  54. data/{spec_resources/views/controller_spec/action_setting_the_assigns_hash.rhtml → spec/resources/views/controller_spec/_partial.rhtml} +0 -0
  55. data/{spec_resources → spec/resources}/views/controller_spec/action_setting_flash_after_session_reset.rhtml +0 -0
  56. data/{spec_resources → spec/resources}/views/controller_spec/action_setting_flash_before_session_reset.rhtml +0 -0
  57. data/{spec_resources/views/layouts/application.rhtml → spec/resources/views/controller_spec/action_setting_the_assigns_hash.rhtml} +0 -0
  58. data/{spec_resources → spec/resources}/views/controller_spec/action_with_errors_in_template.rhtml +0 -0
  59. data/{spec_resources → spec/resources}/views/controller_spec/action_with_template.rhtml +0 -0
  60. data/{spec_resources/views/layouts/simple.rhtml → spec/resources/views/layouts/application.rhtml} +0 -0
  61. data/{spec_resources/views/render_spec/_a_partial.rhtml → spec/resources/views/layouts/simple.rhtml} +0 -0
  62. data/{spec_resources → spec/resources}/views/objects/_object.html.erb +0 -0
  63. data/{spec_resources/views/render_spec/action_with_alternate_layout.rhtml → spec/resources/views/render_spec/_a_partial.rhtml} +0 -0
  64. data/{spec_resources/views/render_spec/some_action.rhtml → spec/resources/views/render_spec/action_with_alternate_layout.rhtml} +0 -0
  65. data/{spec_resources/views/view_spec/_partial_used_twice.rhtml → spec/resources/views/render_spec/some_action.html.erb} +0 -0
  66. data/{spec_resources → spec/resources}/views/render_spec/some_action.js.rjs +0 -0
  67. data/{spec_resources → spec/resources}/views/render_spec/some_action.rjs +0 -0
  68. data/{spec_resources → spec/resources}/views/rjs_spec/_replacement_partial.rhtml +0 -0
  69. data/{spec_resources → spec/resources}/views/rjs_spec/hide_div.rjs +0 -0
  70. data/{spec_resources → spec/resources}/views/rjs_spec/hide_page_element.rjs +0 -0
  71. data/{spec_resources → spec/resources}/views/rjs_spec/insert_html.rjs +0 -0
  72. data/{spec_resources → spec/resources}/views/rjs_spec/replace.rjs +0 -0
  73. data/{spec_resources → spec/resources}/views/rjs_spec/replace_html.rjs +0 -0
  74. data/{spec_resources → spec/resources}/views/rjs_spec/replace_html_with_partial.rjs +0 -0
  75. data/{spec_resources → spec/resources}/views/rjs_spec/visual_effect.rjs +0 -0
  76. data/{spec_resources → spec/resources}/views/rjs_spec/visual_toggle_effect.rjs +0 -0
  77. data/{spec_resources → spec/resources}/views/tag_spec/no_tags.rhtml +0 -0
  78. data/{spec_resources → spec/resources}/views/tag_spec/single_div_with_no_attributes.rhtml +0 -0
  79. data/{spec_resources → spec/resources}/views/tag_spec/single_div_with_one_attribute.rhtml +0 -0
  80. data/{spec_resources → spec/resources}/views/view_spec/_partial.rhtml +0 -0
  81. data/spec/resources/views/view_spec/_partial_used_twice.rhtml +0 -0
  82. data/{spec_resources → spec/resources}/views/view_spec/_partial_with_local_variable.rhtml +0 -0
  83. data/{spec_resources → spec/resources}/views/view_spec/_partial_with_sub_partial.rhtml +0 -0
  84. data/{spec_resources → spec/resources}/views/view_spec/_spacer.rhtml +0 -0
  85. data/{spec_resources → spec/resources}/views/view_spec/accessor.rhtml +0 -0
  86. data/{spec_resources → spec/resources}/views/view_spec/block_helper.rhtml +0 -0
  87. data/{spec_resources → spec/resources}/views/view_spec/entry_form.rhtml +0 -0
  88. data/{spec_resources → spec/resources}/views/view_spec/explicit_helper.rhtml +0 -0
  89. data/{spec_resources → spec/resources}/views/view_spec/foo/show.rhtml +0 -0
  90. data/{spec_resources → spec/resources}/views/view_spec/implicit_helper.rhtml +0 -0
  91. data/{spec_resources → spec/resources}/views/view_spec/multiple_helpers.rhtml +0 -0
  92. data/spec/resources/views/view_spec/path_params.html.erb +1 -0
  93. data/{spec_resources → spec/resources}/views/view_spec/should_not_receive.rhtml +0 -0
  94. data/{spec_resources → spec/resources}/views/view_spec/template_with_partial.rhtml +0 -0
  95. data/{spec_resources → spec/resources}/views/view_spec/template_with_partial_using_collection.rhtml +0 -0
  96. data/{spec_resources → spec/resources}/views/view_spec/template_with_partial_with_array.rhtml +0 -0
  97. data/spec/{rails → spec/rails}/example/assigns_hash_proxy_spec.rb +1 -1
  98. data/spec/spec/rails/example/configuration_spec.rb +79 -0
  99. data/spec/{rails → spec/rails}/example/controller_isolation_spec.rb +1 -7
  100. data/spec/{rails → spec/rails}/example/controller_spec_spec.rb +63 -6
  101. data/spec/{rails → spec/rails}/example/cookies_proxy_spec.rb +30 -13
  102. data/spec/{rails → spec/rails}/example/example_group_factory_spec.rb +1 -1
  103. data/spec/{rails → spec/rails}/example/helper_spec_spec.rb +28 -1
  104. data/spec/{rails → spec/rails}/example/model_spec_spec.rb +1 -1
  105. data/spec/{rails → spec/rails}/example/shared_behaviour_spec.rb +1 -1
  106. data/spec/{rails → spec/rails}/example/test_unit_assertion_accessibility_spec.rb +1 -1
  107. data/spec/{rails → spec/rails}/example/view_spec_spec.rb +22 -1
  108. data/spec/{rails → spec/rails}/extensions/action_controller_rescue_action_spec.rb +4 -1
  109. data/spec/{rails → spec/rails}/extensions/action_view_base_spec.rb +1 -1
  110. data/spec/{rails → spec/rails}/extensions/active_record_spec.rb +1 -1
  111. data/spec/{rails → spec/rails}/interop/testcase_spec.rb +6 -2
  112. data/spec/spec/rails/matchers/ar_be_valid_spec.rb +35 -0
  113. data/spec/{rails → spec/rails}/matchers/assert_select_spec.rb +1 -5
  114. data/spec/{rails → spec/rails}/matchers/errors_on_spec.rb +1 -1
  115. data/spec/{rails → spec/rails}/matchers/have_text_spec.rb +1 -1
  116. data/spec/{rails → spec/rails}/matchers/include_text_spec.rb +1 -1
  117. data/spec/{rails → spec/rails}/matchers/redirect_to_spec.rb +11 -2
  118. data/spec/{rails → spec/rails}/matchers/render_template_spec.rb +8 -4
  119. data/spec/{rails → spec/rails}/matchers/should_change_spec.rb +1 -1
  120. data/spec/{rails → spec/rails}/mocks/ar_classes.rb +0 -0
  121. data/spec/{rails → spec/rails}/mocks/mock_model_spec.rb +1 -1
  122. data/spec/{rails → spec/rails}/mocks/stub_model_spec.rb +1 -1
  123. data/spec/{rails → spec/rails}/sample_modified_fixture.rb +1 -1
  124. data/spec/{rails → spec/rails}/sample_spec.rb +1 -1
  125. data/spec/spec/rails/spec_server_spec.rb +96 -0
  126. data/spec/{rails → spec/rails}/spec_spec.rb +1 -1
  127. data/spec/spec_helper.rb +23 -14
  128. metadata +111 -100
  129. data/UPGRADE +0 -7
  130. data/generators/rspec/templates/all_stories.rb +0 -4
  131. data/generators/rspec/templates/stories_helper.rb +0 -3
  132. data/lib/spec/rails/extensions/object.rb +0 -5
  133. data/spec/rails/example/configuration_spec.rb +0 -83
  134. data/spec/rails/matchers/description_generation_spec.rb +0 -37
  135. data/spec/rails/spec_server_spec.rb +0 -96
  136. data/stories/all.rb +0 -10
  137. data/stories/configuration/stories.rb +0 -5
  138. data/stories/helper.rb +0 -6
  139. data/stories/steps/people.rb +0 -8
  140. data/stories/transactions_should_rollback.rb +0 -25
@@ -1,10 +0,0 @@
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
@@ -1,5 +0,0 @@
1
- require File.join(File.dirname(__FILE__), *%w[.. helper])
2
-
3
- with_steps_for :running_rspec do
4
- run File.join(File.dirname(__FILE__), *%w[.. .. .. rspec stories configuration before_blocks.story]), :type => RailsStory
5
- end
@@ -1,6 +0,0 @@
1
- dir = File.dirname(__FILE__)
2
- $LOAD_PATH.unshift File.expand_path("#{dir}/../lib")
3
- require File.expand_path("#{dir}/../../../../spec/spec_helper")
4
- require File.expand_path("#{dir}/../../rspec/stories/helper")
5
-
6
- require 'spec/rails/story_adapter'
@@ -1,8 +0,0 @@
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
@@ -1,25 +0,0 @@
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