public
Clone URL: git://github.com/robbyrussell/rubyurl.git
Search Repo:
adding some view specs for the links index/show pages

git-svn-id: https://svn.roundhaus.com/planetargon/rubyurl_2-0/trunk@47 
f0bc2f90-cf15-dc11-b192-0016e6374d05
robbyrussell (author)
Tue Jul 31 20:45:00 -0700 2007
commit  7da8eaa3794abb77343eabbe338693f57eecc683
tree    c84fed38522b8c24353f96002001d89fe1bf85d4
parent  50e28adae1c5382cbf80b1456afecaacfa712505
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
0
@@ -1 +1,40 @@
0
+require File.dirname(__FILE__) + '/../../spec_helper'
0
+
0
+describe "links/index" do
0
+ before(:each) do
0
+ render 'links/index'
0
+ end
0
+
0
+ it "should display Create a RubyURL in a h1 tag" do
0
+ response.should have_tag('h1', 'Create a RubyURL')
0
+ end
0
+
0
+ it "should display a text input field for the user to paste their url in" do
0
+ response.should have_tag('input#link_website_url')
0
+ end
0
+end
0
+
0
+describe "links/show" do
0
+
0
+ before(:each) do
0
+ @link = mock_model(Link)
0
+ @link.stub!(:permalink).and_return('http://localhost:3000/x093')
0
+ @link.stub!(:website_url).and_return('http://rubyurl.com/')
0
+ assigns[:link] = @link
0
+ render 'links/show'
0
+ end
0
+
0
+ it "should display Here is your RubyURL in a h1 tag" do
0
+ response.should have_tag('h1', 'Here is your RubyURL')
0
+ end
0
+
0
+ it "should display a link for the user to copy" do
0
+ response.should have_tag('div#url')
0
+ response.should have_tag('a', 'http://localhost:3000/x093')
0
+ end
0
+
0
+ it "should display the correct number of characters for the original URL (16)" do
0
+ response.should have_tag('dd', '19 characters')
0
+ end
0
+end

Comments

    No one has commented yet.