rspec-rails 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -13,8 +13,8 @@ Hoe.new('rspec-rails', Spec::Rails::VERSION::STRING) do |p|
|
|
13
13
|
p.description = "Behaviour Driven Development for Ruby on Rails."
|
14
14
|
p.rubyforge_name = 'rspec'
|
15
15
|
p.developer('RSpec Development Team', 'rspec-devel@rubyforge.org')
|
16
|
-
p.extra_deps = [["rspec","1.2.
|
17
|
-
p.extra_dev_deps = [["cucumber",">= 0.
|
16
|
+
p.extra_deps = [["rspec","1.2.3"],["rack",">=0.4.0"]]
|
17
|
+
p.extra_dev_deps = [["cucumber",">= 0.2.2"]]
|
18
18
|
p.remote_rdoc_dir = "rspec-rails/#{Spec::Rails::VERSION::STRING}"
|
19
19
|
p.history_file = 'History.rdoc'
|
20
20
|
p.readme_file = 'README.rdoc'
|
data/Upgrade.rdoc
CHANGED
@@ -4,7 +4,7 @@ if ARGV.any? {|arg| %w[--drb -X --generate-options -G --help -h --version -v].in
|
|
4
4
|
else
|
5
5
|
gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f >= 1.9
|
6
6
|
ENV["RAILS_ENV"] ||= 'test'
|
7
|
-
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
|
7
|
+
require File.expand_path(File.dirname(__FILE__) + "/../config/environment") unless defined?(RAILS_ROOT)
|
8
8
|
end
|
9
9
|
require 'spec/autorun'
|
10
10
|
exit ::Spec::Runner::CommandLine.run
|
@@ -3,7 +3,7 @@ gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f >= 1.9
|
|
3
3
|
|
4
4
|
puts "Loading Rails environment"
|
5
5
|
ENV["RAILS_ENV"] ||= 'test'
|
6
|
-
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
|
6
|
+
require File.expand_path(File.dirname(__FILE__) + "/../config/environment") unless defined?(RAILS_ROOT)
|
7
7
|
|
8
8
|
require 'optparse'
|
9
9
|
require 'spec/rails/spec_server'
|
@@ -7,75 +7,44 @@ describe <%= controller_class_name %>Controller do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
describe "GET index" do
|
10
|
-
|
11
|
-
it "exposes all <%= table_name.pluralize %> as @<%= table_name.pluralize %>" do
|
10
|
+
it "assigns all <%= table_name.pluralize %> as @<%= table_name.pluralize %>" do
|
12
11
|
<%= class_name %>.should_receive(:find).with(:all).and_return([mock_<%= file_name %>])
|
13
12
|
get :index
|
14
13
|
assigns[:<%= table_name %>].should == [mock_<%= file_name %>]
|
15
14
|
end
|
16
|
-
|
17
|
-
describe "with mime type of xml" do
|
18
|
-
|
19
|
-
it "renders all <%= table_name.pluralize %> as xml" do
|
20
|
-
<%= class_name %>.should_receive(:find).with(:all).and_return(<%= file_name.pluralize %> = mock("Array of <%= class_name.pluralize %>"))
|
21
|
-
<%= file_name.pluralize %>.should_receive(:to_xml).and_return("generated XML")
|
22
|
-
get :index, :format => 'xml'
|
23
|
-
response.body.should == "generated XML"
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
15
|
end
|
29
16
|
|
30
17
|
describe "GET show" do
|
31
|
-
|
32
|
-
it "exposes the requested <%= file_name %> as @<%= file_name %>" do
|
18
|
+
it "assigns the requested <%= file_name %> as @<%= file_name %>" do
|
33
19
|
<%= class_name %>.should_receive(:find).with("37").and_return(mock_<%= file_name %>)
|
34
20
|
get :show, :id => "37"
|
35
21
|
assigns[:<%= file_name %>].should equal(mock_<%= file_name %>)
|
36
22
|
end
|
37
|
-
|
38
|
-
describe "with mime type of xml" do
|
39
|
-
|
40
|
-
it "renders the requested <%= file_name %> as xml" do
|
41
|
-
<%= class_name %>.should_receive(:find).with("37").and_return(mock_<%= file_name %>)
|
42
|
-
mock_<%= file_name %>.should_receive(:to_xml).and_return("generated XML")
|
43
|
-
get :show, :id => "37", :format => 'xml'
|
44
|
-
response.body.should == "generated XML"
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
48
|
-
|
49
23
|
end
|
50
24
|
|
51
25
|
describe "GET new" do
|
52
|
-
|
53
|
-
it "exposes a new <%= file_name %> as @<%= file_name %>" do
|
26
|
+
it "assigns a new <%= file_name %> as @<%= file_name %>" do
|
54
27
|
<%= class_name %>.should_receive(:new).and_return(mock_<%= file_name %>)
|
55
28
|
get :new
|
56
29
|
assigns[:<%= file_name %>].should equal(mock_<%= file_name %>)
|
57
30
|
end
|
58
|
-
|
59
31
|
end
|
60
32
|
|
61
33
|
describe "GET edit" do
|
62
|
-
|
63
|
-
it "exposes the requested <%= file_name %> as @<%= file_name %>" do
|
34
|
+
it "assigns the requested <%= file_name %> as @<%= file_name %>" do
|
64
35
|
<%= class_name %>.should_receive(:find).with("37").and_return(mock_<%= file_name %>)
|
65
36
|
get :edit, :id => "37"
|
66
37
|
assigns[:<%= file_name %>].should equal(mock_<%= file_name %>)
|
67
38
|
end
|
68
|
-
|
69
39
|
end
|
70
40
|
|
71
41
|
describe "POST create" do
|
72
|
-
|
42
|
+
|
73
43
|
describe "with valid params" do
|
74
|
-
|
75
|
-
it "exposes a newly created <%= file_name %> as @<%= file_name %>" do
|
44
|
+
it "assigns a newly created <%= file_name %> as @<%= file_name %>" do
|
76
45
|
<%= class_name %>.should_receive(:new).with({'these' => 'params'}).and_return(mock_<%= file_name %>(:save => true))
|
77
46
|
post :create, :<%= file_name %> => {:these => 'params'}
|
78
|
-
assigns
|
47
|
+
assigns[:<%= file_name %>].should equal(mock_<%= file_name %>)
|
79
48
|
end
|
80
49
|
|
81
50
|
it "redirects to the created <%= file_name %>" do
|
@@ -83,15 +52,13 @@ describe <%= controller_class_name %>Controller do
|
|
83
52
|
post :create, :<%= file_name %> => {}
|
84
53
|
response.should redirect_to(<%= table_name.singularize %>_url(mock_<%= file_name %>))
|
85
54
|
end
|
86
|
-
|
87
55
|
end
|
88
56
|
|
89
57
|
describe "with invalid params" do
|
90
|
-
|
91
|
-
it "exposes a newly created but unsaved <%= file_name %> as @<%= file_name %>" do
|
58
|
+
it "assigns a newly created but unsaved <%= file_name %> as @<%= file_name %>" do
|
92
59
|
<%= class_name %>.stub!(:new).with({'these' => 'params'}).and_return(mock_<%= file_name %>(:save => false))
|
93
60
|
post :create, :<%= file_name %> => {:these => 'params'}
|
94
|
-
assigns
|
61
|
+
assigns[:<%= file_name %>].should equal(mock_<%= file_name %>)
|
95
62
|
end
|
96
63
|
|
97
64
|
it "re-renders the 'new' template" do
|
@@ -99,25 +66,23 @@ describe <%= controller_class_name %>Controller do
|
|
99
66
|
post :create, :<%= file_name %> => {}
|
100
67
|
response.should render_template('new')
|
101
68
|
end
|
102
|
-
|
103
69
|
end
|
104
70
|
|
105
71
|
end
|
106
72
|
|
107
73
|
describe "PUT udpate" do
|
108
|
-
|
74
|
+
|
109
75
|
describe "with valid params" do
|
110
|
-
|
111
76
|
it "updates the requested <%= file_name %>" do
|
112
77
|
<%= class_name %>.should_receive(:find).with("37").and_return(mock_<%= file_name %>)
|
113
78
|
mock_<%= file_name %>.should_receive(:update_attributes).with({'these' => 'params'})
|
114
79
|
put :update, :id => "37", :<%= file_name %> => {:these => 'params'}
|
115
80
|
end
|
116
81
|
|
117
|
-
it "
|
82
|
+
it "assigns the requested <%= file_name %> as @<%= file_name %>" do
|
118
83
|
<%= class_name %>.stub!(:find).and_return(mock_<%= file_name %>(:update_attributes => true))
|
119
84
|
put :update, :id => "1"
|
120
|
-
assigns
|
85
|
+
assigns[:<%= file_name %>].should equal(mock_<%= file_name %>)
|
121
86
|
end
|
122
87
|
|
123
88
|
it "redirects to the <%= file_name %>" do
|
@@ -125,21 +90,19 @@ describe <%= controller_class_name %>Controller do
|
|
125
90
|
put :update, :id => "1"
|
126
91
|
response.should redirect_to(<%= table_name.singularize %>_url(mock_<%= file_name %>))
|
127
92
|
end
|
128
|
-
|
129
93
|
end
|
130
94
|
|
131
95
|
describe "with invalid params" do
|
132
|
-
|
133
96
|
it "updates the requested <%= file_name %>" do
|
134
97
|
<%= class_name %>.should_receive(:find).with("37").and_return(mock_<%= file_name %>)
|
135
98
|
mock_<%= file_name %>.should_receive(:update_attributes).with({'these' => 'params'})
|
136
99
|
put :update, :id => "37", :<%= file_name %> => {:these => 'params'}
|
137
100
|
end
|
138
101
|
|
139
|
-
it "
|
102
|
+
it "assigns the <%= file_name %> as @<%= file_name %>" do
|
140
103
|
<%= class_name %>.stub!(:find).and_return(mock_<%= file_name %>(:update_attributes => false))
|
141
104
|
put :update, :id => "1"
|
142
|
-
assigns
|
105
|
+
assigns[:<%= file_name %>].should equal(mock_<%= file_name %>)
|
143
106
|
end
|
144
107
|
|
145
108
|
it "re-renders the 'edit' template" do
|
@@ -147,13 +110,11 @@ describe <%= controller_class_name %>Controller do
|
|
147
110
|
put :update, :id => "1"
|
148
111
|
response.should render_template('edit')
|
149
112
|
end
|
150
|
-
|
151
113
|
end
|
152
|
-
|
114
|
+
|
153
115
|
end
|
154
116
|
|
155
117
|
describe "DELETE destroy" do
|
156
|
-
|
157
118
|
it "destroys the requested <%= file_name %>" do
|
158
119
|
<%= class_name %>.should_receive(:find).with("37").and_return(mock_<%= file_name %>)
|
159
120
|
mock_<%= file_name %>.should_receive(:destroy)
|
@@ -165,7 +126,6 @@ describe <%= controller_class_name %>Controller do
|
|
165
126
|
delete :destroy, :id => "1"
|
166
127
|
response.should redirect_to(<%= table_name %>_url)
|
167
128
|
end
|
168
|
-
|
169
129
|
end
|
170
130
|
|
171
131
|
end
|
data/lib/spec/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RSpec Development Team
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-04-13 00:00:00 -03:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - "="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 1.2.
|
23
|
+
version: 1.2.3
|
24
24
|
version:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rack
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.
|
43
|
+
version: 0.2.2
|
44
44
|
version:
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: hoe
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.
|
53
|
+
version: 1.12.1
|
54
54
|
version:
|
55
55
|
description: Behaviour Driven Development for Ruby on Rails.
|
56
56
|
email:
|
@@ -236,7 +236,7 @@ homepage: http://rspec.info
|
|
236
236
|
post_install_message: |
|
237
237
|
**************************************************
|
238
238
|
|
239
|
-
Thank you for installing rspec-rails-1.2.
|
239
|
+
Thank you for installing rspec-rails-1.2.3
|
240
240
|
|
241
241
|
If you are upgrading, do this in each of your rails apps
|
242
242
|
that you want to upgrade:
|
@@ -271,6 +271,6 @@ rubyforge_project: rspec
|
|
271
271
|
rubygems_version: 1.3.1
|
272
272
|
signing_key:
|
273
273
|
specification_version: 2
|
274
|
-
summary: rspec-rails 1.2.
|
274
|
+
summary: rspec-rails 1.2.3
|
275
275
|
test_files: []
|
276
276
|
|