public
Clone URL: git://github.com/robbyrussell/rubyurl.git
Search Repo:
Adding more coverage for the LinksController. Update of header text

git-svn-id: https://svn.roundhaus.com/planetargon/rubyurl_2-0/trunk@80 
f0bc2f90-cf15-dc11-b192-0016e6374d05
robbyrussell (author)
Tue Aug 28 10:26:52 -0700 2007
commit  f3b845519de3fbf74bd4885c69edfcf429dd6c53
tree    706aab7853c25f80dd2ade802abff6a27e82ac29
parent  66f94a5f2d8baba48e16ed14ee1275b79522a2ec
...
1
2
3
 
4
5
6
...
1
2
 
3
4
5
6
0
@@ -1,6 +1,6 @@
0
 <a id="logo" href="/" title="RubyURL">RubyURL</a>
0
 <ul id="main_nav">
0
- <li><%= link_to 'What is rubyURL?', '/about' -%></li>
0
+ <li><%= link_to 'What is RubyURL?', '/about' -%></li>
0
   <li><%= link_to 'API Documentation', '/api' -%></li>
0
   <li><%= link_to 'Report Abuse!', '/report-abuse', :id => 'abuse' -%></li>
0
 </ul>
...
1
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
4
5
6
...
18
19
20
 
 
21
22
 
 
 
 
 
23
24
25
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
...
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
0
@@ -1,5 +1,23 @@
0
 require File.dirname(__FILE__) + '/../spec_helper'
0
 
0
+describe LinksController, "index action" do
0
+ controller_name :links
0
+
0
+ before(:each) do
0
+ @link = mock('link')
0
+ Link.stub!(:new).and_return(@link)
0
+ get :index
0
+ end
0
+
0
+ it "should render the index view" do
0
+ response.should render_template('links/index')
0
+ end
0
+
0
+ it "should instantiate a new link variable" do
0
+ assigns[:link].should equal(@link)
0
+ end
0
+end
0
+
0
 describe LinksController do
0
   include LinkSpecHelper
0
 
0
0
@@ -18,8 +36,15 @@
0
 end
0
 
0
 describe LinksController, "redirect routing" do
0
+ controller_name :links
0
+
0
   it "should route to the redirect action in LinksController" do
0
     assert_routing '/abc', { :controller => 'links', :action => 'redirect', :token => 'abc' }
0
+ end
0
+
0
+ it "should redirect to the invalid page when the token is invalid" do
0
+ get :redirect, :token => 'magoo'
0
+ response.should redirect_to( :action => 'invalid' )
0
   end
0
 end
0
 

Comments

    No one has commented yet.