Skip to content
This repository
Browse code

move some docs around

  • Loading branch information...
commit 3b279c63397975ef95219ecdb53b497ebc8dc9f0 1 parent 4e37c9b
David Chelimsky authored January 27, 2011
124  History.md
Source Rendered
... ...
@@ -1,123 +1 @@
1  
-## rspec-rails-2 release history
2  
-
3  
-### 2.4.2 / in dev
4  
-
5  
-[full changelog](http://github.com/rspec/rspec-rails/compare/v2.4.1...master)
6  
-
7  
-* Bug fixes
8  
-  * fixed bug in which `render_views` in a nested group set the value in its
9  
-    parent group.
10  
-  * only include MailerExampleGroup when it is defiend (Steve Sloan)
11  
-
12  
-### 2.4.1 / 2011-01-03
13  
-
14  
-[full changelog](http://github.com/rspec/rspec-rails/compare/v2.4.0...v2.4.1)
15  
-
16  
-* Bug fixes
17  
-  * fixed bug caused by including some Rails modules before RSpec's
18  
-    RailsExampleGroup
19  
-
20  
-### 2.4.0 / 2011-01-02
21  
-
22  
-[full changelog](http://github.com/rspec/rspec-rails/compare/v2.3.1...v2.4.0)
23  
-
24  
-* Enhancements
25  
-  * include ApplicationHelper in helper object in helper specs
26  
-  * include request spec extensions in files in spec/integration
27  
-  * include controller spec extensions in groups that use :type => :controller
28  
-    * same for :model, :view, :helper, :mailer, :request, :routing
29  
-
30  
-* Bug fixes
31  
-  * restore global config.render_views so you only need to say it once
32  
-  * support overriding render_views in nested groups
33  
-  * matchers that delegate to Rails' assertions capture
34  
-    ActiveSupport::TestCase::Assertion (so they work properly now with
35  
-    should_not in Ruby 1.8.7 and 1.9.1)
36  
-
37  
-* Deprecations
38  
-  * include_self_when_dir_matches
39  
-
40  
-### 2.3.1 / 2010-12-16
41  
-
42  
-[full changelog](http://github.com/rspec/rspec-rails/compare/v2.3.0...v2.3.1)
43  
-
44  
-* Bug fixes
45  
-  * respond_to? correctly handles 2 args
46  
-  * scaffold generator no longer fails on autotest directory
47  
-
48  
-### 2.3.0 / 2010-12-12
49  
-
50  
-[full changelog](http://github.com/rspec/rspec-rails/compare/v2.2.1...v2.3.0)
51  
-
52  
-* Changes
53  
-  * Generator no longer generates autotest/autodiscover.rb, as it is no longer
54  
-    needed (as of rspec-core-2.3.0)
55  
-
56  
-### 2.2.1 / 2010-12-01
57  
-
58  
-[full changelog](http://github.com/rspec/rspec-rails/compare/v2.2.0...v2.2.1)
59  
-
60  
-* Bug fixes
61  
-  * Depend on railties, activesupport, and actionpack instead of rails (Piotr
62  
-    Solnica)
63  
-  * Got webrat integration working properly across different types of specs
64  
-
65  
-* Deprecations
66  
-  * --webrat-matchers flag for generators is deprecated. use --webrat instead.
67  
-
68  
-### 2.2.0 / 2010-11-28
69  
-
70  
-[full changelog](http://github.com/rspec/rspec-rails/compare/v2.1.0...v2.2.0)
71  
-
72  
-* Enhancements
73  
-  * Added stub_template in view specs
74  
-
75  
-* Bug fixes
76  
-  * Properly include helpers in views (Jonathan del Strother)
77  
-  * Fix bug in which method missing led to a stack overflow
78  
-  * Fix stack overflow in request specs with open_session
79  
-  * Fix stack overflow in any spec when method_missing was invoked
80  
-  * Add gem dependency on rails ~> 3.0.0 (ensures bundler won't install
81  
-    rspec-rails-2 with rails-2 apps).
82  
-
83  
-### 2.1.0 / 2010-11-07
84  
-
85  
-[full changelog](http://github.com/rspec/rspec-rails/compare/v2.0.1...v2.1.0)
86  
-
87  
-* Enhancements
88  
-  * Move errors_on to ActiveModel to support other AM-compliant ORMs
89  
-
90  
-* Bug fixes
91  
-  * Check for presence of ActiveRecord instead of checking Rails config
92  
-    (gets rspec out of the way of multiple ORMs in the same app)
93  
-
94  
-### 2.0.1 / 2010-10-15
95  
-
96  
-[full changelog](http://github.com/rspec/rspec-rails/compare/v2.0.0...v2.0.1)
97  
-
98  
-* Enhancements
99  
-  * Add option to not generate request spec (--skip-request-specs)
100  
-
101  
-* Bug fixes
102  
-  * Updated the mock_[model] method generated in controller specs so it adds
103  
-    any stubs submitted each time it is called.
104  
-  * Fixed bug where view assigns weren't making it to the view in view specs in Rails-3.0.1.
105  
-    (Emanuele Vicentini)
106  
-
107  
-### 2.0.0 / 2010-10-10
108  
-
109  
-[full changelog](https://github.com/rspec/rspec-rails/compare/ea6bdef...v2.0.0)
110  
-
111  
-* Enhancements
112  
-  * ControllerExampleGroup uses controller as the implicit subject by default (Paul Rosania)
113  
-  * autotest mapping improvements (Andreas Neuhaus)
114  
-  * more cucumber features (Justin Ko)
115  
-  * clean up spec helper (Andre Arko)
116  
-  * add assign(name, value) to helper specs (Justin Ko)
117  
-  * stub_model supports primary keys other than id (Justin Ko)
118  
-  * support choice between Webrat/Capybara (Justin Ko)
119  
-  * support specs for 'abstract' subclasses of ActionController::Base (Mike Gehard)
120  
-  * be_a_new matcher supports args (Justin Ko)
121  
-
122  
-* Bug fixes
123  
-  * support T::U components in mailer and request specs (Brasten Sager)
  1
+See features/Changelog.md
64  Upgrade.md
Source Rendered
... ...
@@ -1,63 +1 @@
1  
-# rspec-rails-2.3.0
2  
-
3  
-## autotest integration
4  
-
5  
-Add a .rspec file to the project's root directory (if not already there) to
6  
-tell RSpec to tell Autotest to use RSpec's specialized Autotest class.
7  
-
8  
-NOTE that rspec-core-2.0, 2.1, and 2.2 required an autotest/discover.rb file in
9  
-the project's root directory. This worked with some, but not all versions of
10  
-autotest and/or the autotest command that ships with ZenTest. This new approach
11  
-will work regardless of which version of autotest/ZenTest you are using.
12  
-
13  
-## Webrat and Capybara
14  
-
15  
-Earlier 2.0.0.beta versions depended on Webrat. As of
16  
-rspec-rails-2.0.0.beta.20, this dependency and offers you a choice of using
17  
-webrat or capybara. Just add the library of your choice to your Gemfile.
18  
-
19  
-## Controller specs
20  
-
21  
-### islation from view templates
22  
-
23  
-By default, controller specs do _not_ render view templates. This keeps
24  
-controller specs isolated from the content of views and their requirements.
25  
-
26  
-NOTE that the template must exist, but it will not be rendered.  This is
27  
-different from rspec-rails-1.x, in which the template didn't need to exist, but
28  
-ActionController makes a number of new decisions in Rails 3 based on the
29  
-existence of the template. To keep the RSpec code free of monkey patches, and
30  
-to keep the rspec user experience simpler, we decided that this would be a fair
31  
-trade-off.
32  
-
33  
-## View specs
34  
-
35  
-### view.should render_template
36  
-
37  
-Rails changed the way it renders partials, so to set an expectation that a
38  
-partial gets rendered, you need 
39  
-
40  
-    render
41  
-    view.should render_template(:partial => "widget/_row")
42  
-
43  
-### stub_template
44  
-
45  
-Introduced in rspec-rails-2.2, simulates the presence of view templates on the
46  
-file system. This supports isolation from partials rendered by the vew template
47  
-that is the subject of a view example:
48  
-
49  
-    stub_template "widgets/_widget.html.erb" => "This Content"
50  
-
51  
-### as_new_record
52  
-
53  
-Earlier versions of the view generators generated stub_model with `:new_record?
54  
-=> true`. That is no longer recognized in rspec-rails-2, so you need to change
55  
-this:
56  
-  
57  
-    stub_model(Widget, :new_record? => true)
58  
-
59  
-to this:
60  
-
61  
-    stub_model(Widget).as_new_record
62  
-
63  
-Generators in 2.0.0 final release will do the latter.
  1
+See features/Upgrade.md
5  features/.nav
... ...
@@ -1,8 +1,9 @@
1 1
 - GettingStarted.md (Start from scratch)
2  
-- Upgrade.md (Upgrade from 1.x)
3 2
 - Generators.md (Generators)
4  
-- Autotest.md (Autotest integration)
5 3
 - transactional_examples.feature
  4
+- Autotest.md (Autotest integration)
  5
+- Changelog.md
  6
+- Upgrade.md
6 7
 - model_specs:
7 8
   - errors_on.feature
8 9
 - controller_specs:
123  features/Changelog.md
Source Rendered
... ...
@@ -0,0 +1,123 @@
  1
+## rspec-rails-2 release history
  2
+
  3
+### in dev
  4
+
  5
+[full changelog](http://github.com/rspec/rspec-rails/compare/v2.4.1...master)
  6
+
  7
+* Bug fixes
  8
+  * fixed bug in which `render_views` in a nested group set the value in its
  9
+    parent group.
  10
+  * only include MailerExampleGroup when it is defiend (Steve Sloan)
  11
+
  12
+### 2.4.1 / 2011-01-03
  13
+
  14
+[full changelog](http://github.com/rspec/rspec-rails/compare/v2.4.0...v2.4.1)
  15
+
  16
+* Bug fixes
  17
+  * fixed bug caused by including some Rails modules before RSpec's
  18
+    RailsExampleGroup
  19
+
  20
+### 2.4.0 / 2011-01-02
  21
+
  22
+[full changelog](http://github.com/rspec/rspec-rails/compare/v2.3.1...v2.4.0)
  23
+
  24
+* Enhancements
  25
+  * include ApplicationHelper in helper object in helper specs
  26
+  * include request spec extensions in files in spec/integration
  27
+  * include controller spec extensions in groups that use :type => :controller
  28
+    * same for :model, :view, :helper, :mailer, :request, :routing
  29
+
  30
+* Bug fixes
  31
+  * restore global config.render_views so you only need to say it once
  32
+  * support overriding render_views in nested groups
  33
+  * matchers that delegate to Rails' assertions capture
  34
+    ActiveSupport::TestCase::Assertion (so they work properly now with
  35
+    should_not in Ruby 1.8.7 and 1.9.1)
  36
+
  37
+* Deprecations
  38
+  * include_self_when_dir_matches
  39
+
  40
+### 2.3.1 / 2010-12-16
  41
+
  42
+[full changelog](http://github.com/rspec/rspec-rails/compare/v2.3.0...v2.3.1)
  43
+
  44
+* Bug fixes
  45
+  * respond_to? correctly handles 2 args
  46
+  * scaffold generator no longer fails on autotest directory
  47
+
  48
+### 2.3.0 / 2010-12-12
  49
+
  50
+[full changelog](http://github.com/rspec/rspec-rails/compare/v2.2.1...v2.3.0)
  51
+
  52
+* Changes
  53
+  * Generator no longer generates autotest/autodiscover.rb, as it is no longer
  54
+    needed (as of rspec-core-2.3.0)
  55
+
  56
+### 2.2.1 / 2010-12-01
  57
+
  58
+[full changelog](http://github.com/rspec/rspec-rails/compare/v2.2.0...v2.2.1)
  59
+
  60
+* Bug fixes
  61
+  * Depend on railties, activesupport, and actionpack instead of rails (Piotr
  62
+    Solnica)
  63
+  * Got webrat integration working properly across different types of specs
  64
+
  65
+* Deprecations
  66
+  * --webrat-matchers flag for generators is deprecated. use --webrat instead.
  67
+
  68
+### 2.2.0 / 2010-11-28
  69
+
  70
+[full changelog](http://github.com/rspec/rspec-rails/compare/v2.1.0...v2.2.0)
  71
+
  72
+* Enhancements
  73
+  * Added stub_template in view specs
  74
+
  75
+* Bug fixes
  76
+  * Properly include helpers in views (Jonathan del Strother)
  77
+  * Fix bug in which method missing led to a stack overflow
  78
+  * Fix stack overflow in request specs with open_session
  79
+  * Fix stack overflow in any spec when method_missing was invoked
  80
+  * Add gem dependency on rails ~> 3.0.0 (ensures bundler won't install
  81
+    rspec-rails-2 with rails-2 apps).
  82
+
  83
+### 2.1.0 / 2010-11-07
  84
+
  85
+[full changelog](http://github.com/rspec/rspec-rails/compare/v2.0.1...v2.1.0)
  86
+
  87
+* Enhancements
  88
+  * Move errors_on to ActiveModel to support other AM-compliant ORMs
  89
+
  90
+* Bug fixes
  91
+  * Check for presence of ActiveRecord instead of checking Rails config
  92
+    (gets rspec out of the way of multiple ORMs in the same app)
  93
+
  94
+### 2.0.1 / 2010-10-15
  95
+
  96
+[full changelog](http://github.com/rspec/rspec-rails/compare/v2.0.0...v2.0.1)
  97
+
  98
+* Enhancements
  99
+  * Add option to not generate request spec (--skip-request-specs)
  100
+
  101
+* Bug fixes
  102
+  * Updated the mock_[model] method generated in controller specs so it adds
  103
+    any stubs submitted each time it is called.
  104
+  * Fixed bug where view assigns weren't making it to the view in view specs in Rails-3.0.1.
  105
+    (Emanuele Vicentini)
  106
+
  107
+### 2.0.0 / 2010-10-10
  108
+
  109
+[full changelog](https://github.com/rspec/rspec-rails/compare/ea6bdef...v2.0.0)
  110
+
  111
+* Enhancements
  112
+  * ControllerExampleGroup uses controller as the implicit subject by default (Paul Rosania)
  113
+  * autotest mapping improvements (Andreas Neuhaus)
  114
+  * more cucumber features (Justin Ko)
  115
+  * clean up spec helper (Andre Arko)
  116
+  * add assign(name, value) to helper specs (Justin Ko)
  117
+  * stub_model supports primary keys other than id (Justin Ko)
  118
+  * support choice between Webrat/Capybara (Justin Ko)
  119
+  * support specs for 'abstract' subclasses of ActionController::Base (Mike Gehard)
  120
+  * be_a_new matcher supports args (Justin Ko)
  121
+
  122
+* Bug fixes
  123
+  * support T::U components in mailer and request specs (Brasten Sager)
44  features/Upgrade.md
Source Rendered
@@ -36,6 +36,18 @@ is what you need to change:
36 36
 
37 37
 ## Controller specs
38 38
 
  39
+### islation from view templates
  40
+
  41
+By default, controller specs do _not_ render view templates. This keeps
  42
+controller specs isolated from the content of views and their requirements.
  43
+
  44
+NOTE that the template must exist, but it will not be rendered.  This is
  45
+different from rspec-rails-1.x, in which the template didn't need to exist, but
  46
+ActionController makes a number of new decisions in Rails 3 based on the
  47
+existence of the template. To keep the RSpec code free of monkey patches, and
  48
+to keep the rspec user experience simpler, we decided that this would be a fair
  49
+trade-off.
  50
+
39 51
 ### `response.should render_template`
40 52
 
41 53
 This needs to move from before the action to after. For example:
@@ -57,6 +69,22 @@ action.
57 69
 
58 70
 ## View specs
59 71
 
  72
+### `view.should render_template`
  73
+
  74
+Rails changed the way it renders partials, so to set an expectation that a
  75
+partial gets rendered, you need 
  76
+
  77
+    render
  78
+    view.should render_template(:partial => "widget/_row")
  79
+
  80
+### stub_template
  81
+
  82
+Introduced in rspec-rails-2.2, simulates the presence of view templates on the
  83
+file system. This supports isolation from partials rendered by the vew template
  84
+that is the subject of a view example:
  85
+
  86
+    stub_template "widgets/_widget.html.erb" => "This Content"
  87
+
60 88
 ### No more `have_tag`
61 89
 
62 90
 Before Webrat came along, rspec-rails had its own `have_tag` matcher that
@@ -70,3 +98,19 @@ are already available in controller specs with `render_views`).
70 98
 Given the brittleness of RSpec's `have_tag` matcher and the presence of new
71 99
 Webrat and Capybara matchers that do a better job, `have_tag` was not included
72 100
 in rspec-rails-2.
  101
+
  102
+## Mocks, stubs, doubles
  103
+
  104
+### as_new_record
  105
+
  106
+Earlier versions of the view generators generated stub_model with `:new_record?
  107
+=> true`. That is no longer recognized in rspec-rails-2, so you need to change
  108
+this:
  109
+  
  110
+    stub_model(Widget, :new_record? => true)
  111
+
  112
+to this:
  113
+
  114
+    stub_model(Widget).as_new_record
  115
+
  116
+Generators in 2.0.0 final release will do the latter.

0 notes on commit 3b279c6

Please sign in to comment.
Something went wrong with that request. Please try again.