Skip to content

Commit a1b7b64

Browse files
author
saasbook
committed
final hw4
1 parent 598a789 commit a1b7b64

File tree

5 files changed

+19
-15
lines changed

5 files changed

+19
-15
lines changed

coverage/.resultset.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
null
107107
]
108108
},
109-
"timestamp": 1330015456
109+
"timestamp": 1330033400
110110
},
111111
"RSpec": {
112112
"coverage": {
@@ -210,11 +210,11 @@
210210
null,
211211
null,
212212
1,
213-
1,
213+
0,
214214
null,
215215
null
216216
]
217217
},
218-
"timestamp": 1330015434
218+
"timestamp": 1330033379
219219
}
220220
}

coverage/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<img src="./assets/0.5.3/loading.gif" alt="loading"/>
2424
</div>
2525
<div id="wrapper" style="display:none;">
26-
<div class="timestamp">Generated <abbr class="timeago" title="2012-02-23T08:44:16-08:00">2012-02-23T08:44:16-08:00</abbr></div>
26+
<div class="timestamp">Generated <abbr class="timeago" title="2012-02-23T13:43:21-08:00">2012-02-23T13:43:21-08:00</abbr></div>
2727
<ul class="group_tabs"></ul>
2828

2929
<div id="content">
@@ -34,7 +34,7 @@ <h2>
3434
covered at
3535
<span class="covered_strength">
3636
<span class="green">
37-
3.1
37+
3.06
3838
</span>
3939
</span> hits/line)
4040
</h2>
@@ -106,7 +106,7 @@ <h2>
106106
<td>5</td>
107107
<td>5</td>
108108
<td>0</td>
109-
<td>5.4</td>
109+
<td>5.2</td>
110110
</tr>
111111

112112
</tbody>
@@ -179,7 +179,7 @@ <h2>
179179
covered at
180180
<span class="covered_strength">
181181
<span class="green">
182-
5.4
182+
5.2
183183
</span>
184184
</span> hits/line)
185185
</h2>
@@ -211,7 +211,7 @@ <h2>
211211
<td>5</td>
212212
<td>5</td>
213213
<td>0</td>
214-
<td>5.4</td>
214+
<td>5.2</td>
215215
</tr>
216216

217217
</tbody>
@@ -1029,8 +1029,8 @@ <h4><span class="green">100.0 %</span> covered</h4>
10291029
<code class="ruby"> def self.similar_directors(director)</code>
10301030
</li>
10311031

1032-
<li class="covered" data-hits="2" data-linenumber="7">
1033-
<span class="hits">2</span>
1032+
<li class="covered" data-hits="1" data-linenumber="7">
1033+
<span class="hits">1</span>
10341034

10351035
<code class="ruby"> Movie.where(:director =&gt; director)</code>
10361036
</li>

heroku_uri

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
http://growing-dawn-4853.herokuapp.com/

hw4.tar.gz

27.9 KB
Binary file not shown.

spec/controllers/movies_controller_spec.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@
2424
should route_to(:controller => "movies", :action => "similar", :movie_id => "1")
2525
end
2626
it 'should call the model method that finds similar movies' do
27-
Movie.should_receive(:similar_directors).with('director').and_return(@fake_results)
28-
put :similar, :movie_id => "1"
27+
fake_results = [mock('Movie'), mock('Movie')]
28+
Movie.should_receive(:similar_directors).with('director').and_return(fake_results)
29+
get :similar, :movie_id => "1"
2930
end
30-
it 'should select the Similar template for rendering' do
31-
put :similar, :movie_id => "1"
31+
it 'should select the Similar template for rendering and make results available' do
32+
Movie.stub!(:similar_directors).with('director').and_return(@m)
33+
get :similar, :movie_id => "1"
3234
response.should render_template('similar')
35+
assigns(:movies).should == @m
3336
end
3437
end
3538

@@ -44,7 +47,7 @@
4447
should route_to(:controller => "movies", :action => "similar", :movie_id => "1")
4548
end
4649
it 'should select the Index template for rendering and generate a flash' do
47-
put :similar, :movie_id => "1"
50+
get :similar, :movie_id => "1"
4851
response.should redirect_to(movies_path)
4952
flash[:notice].should_not be_blank
5053
end

0 commit comments

Comments
 (0)