Skip to content

Commit

Permalink
final hw4
Browse files Browse the repository at this point in the history
  • Loading branch information
saasbook committed Feb 23, 2012
1 parent 598a789 commit a1b7b64
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
6 changes: 3 additions & 3 deletions coverage/.resultset.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
null
]
},
"timestamp": 1330015456
"timestamp": 1330033400
},
"RSpec": {
"coverage": {
Expand Down Expand Up @@ -210,11 +210,11 @@
null,
null,
1,
1,
0,
null,
null
]
},
"timestamp": 1330015434
"timestamp": 1330033379
}
}
14 changes: 7 additions & 7 deletions coverage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<img src="./assets/0.5.3/loading.gif" alt="loading"/>
</div>
<div id="wrapper" style="display:none;">
<div class="timestamp">Generated <abbr class="timeago" title="2012-02-23T08:44:16-08:00">2012-02-23T08:44:16-08:00</abbr></div>
<div class="timestamp">Generated <abbr class="timeago" title="2012-02-23T13:43:21-08:00">2012-02-23T13:43:21-08:00</abbr></div>
<ul class="group_tabs"></ul>

<div id="content">
Expand All @@ -34,7 +34,7 @@ <h2>
covered at
<span class="covered_strength">
<span class="green">
3.1
3.06
</span>
</span> hits/line)
</h2>
Expand Down Expand Up @@ -106,7 +106,7 @@ <h2>
<td>5</td>
<td>5</td>
<td>0</td>
<td>5.4</td>
<td>5.2</td>
</tr>

</tbody>
Expand Down Expand Up @@ -179,7 +179,7 @@ <h2>
covered at
<span class="covered_strength">
<span class="green">
5.4
5.2
</span>
</span> hits/line)
</h2>
Expand Down Expand Up @@ -211,7 +211,7 @@ <h2>
<td>5</td>
<td>5</td>
<td>0</td>
<td>5.4</td>
<td>5.2</td>
</tr>

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

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

<code class="ruby"> Movie.where(:director =&gt; director)</code>
</li>
Expand Down
1 change: 1 addition & 0 deletions heroku_uri
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
http://growing-dawn-4853.herokuapp.com/
Binary file added hw4.tar.gz
Binary file not shown.
13 changes: 8 additions & 5 deletions spec/controllers/movies_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@
should route_to(:controller => "movies", :action => "similar", :movie_id => "1")
end
it 'should call the model method that finds similar movies' do
Movie.should_receive(:similar_directors).with('director').and_return(@fake_results)
put :similar, :movie_id => "1"
fake_results = [mock('Movie'), mock('Movie')]
Movie.should_receive(:similar_directors).with('director').and_return(fake_results)
get :similar, :movie_id => "1"
end
it 'should select the Similar template for rendering' do
put :similar, :movie_id => "1"
it 'should select the Similar template for rendering and make results available' do
Movie.stub!(:similar_directors).with('director').and_return(@m)
get :similar, :movie_id => "1"
response.should render_template('similar')
assigns(:movies).should == @m
end
end

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

0 comments on commit a1b7b64

Please sign in to comment.