public
Clone URL: git://github.com/robbyrussell/rubyurl.git
Search Repo:
adding more specs for LinksController

git-svn-id: https://svn.roundhaus.com/planetargon/rubyurl_2-0/trunk@31 
f0bc2f90-cf15-dc11-b192-0016e6374d05
robbyrussell (author)
Mon Jul 16 19:10:17 -0700 2007
commit  8d96a6b9856ac3cd94b08be287bf09d3645a1b35
tree    df7aa5c6bf761c3100e51f2fb7ce8fe5cb9885f5
parent  b3e82466dbadb69f26be109ac63c4946f53e73f0
...
16
17
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
0
@@ -16,3 +16,25 @@ describe LinksController do
0
     end.should change(Link, :count).by(1)
0
   end
0
 end
0
+
0
+describe LinksController, "redirect routing" do
0
+ it "should route to the redirect action in LinksController" do
0
+ assert_routing '/abc', { :controller => 'links', :action => 'redirect', :token => 'abc' }
0
+ end
0
+end
0
+
0
+describe LinksController, "redirect with token" do
0
+
0
+ before(:each) do
0
+ @link = mock( 'link' )
0
+ Link.should_receive( :find_by_token ).with( 'abc' ).and_return( @link )
0
+ @link.stub!( :add_visit )
0
+ @link.should_receive( :website_url ).and_return( 'http://google.com/' )
0
+ get :redirect, :token => 'abc'
0
+ end
0
+
0
+ it "should call redirected to a website when passed a token" do
0
+ response.should redirect_to( 'http://google.com/' )
0
+ end
0
+end
0
+

Comments

    No one has commented yet.