Permalink
Browse files

site index test

  • Loading branch information...
1 parent 4fdb2ce commit 76ce826e031707acd2d3120dfebad1a7fc5f629b @john-griffin committed Mar 1, 2010
@@ -0,0 +1,17 @@
+require 'spec_helper'
+
+describe SitesController do
+
+ #Delete these examples and add some real ones
+ it "should use SitesController" do
+ controller.should be_an_instance_of(SitesController)
+ end
+
+
+ describe "GET 'index'" do
+ it "should be successful" do
+ get 'index'
+ response.should be_success
+ end
+ end
+end
@@ -0,0 +1,11 @@
+require 'spec_helper'
+
+describe SitesHelper do
+
+ #Delete this example and add some real ones or delete this file
+ it "should be included in the object returned by #helper" do
+ included_modules = (class << helper; self; end).send :included_modules
+ included_modules.should include(SitesHelper)
+ end
+
+end
@@ -0,0 +1,17 @@
+require 'spec_helper'
+
+describe "/sites/index" do
+ before(:each) do
+ site = mock_model(Site)
+ bookmark = mock_model(Bookmark)
+ bookmark.should_receive(:count).and_return(1)
+ site.should_receive(:url).and_return("www.google.com")
+ site.should_receive(:bookmarks).and_return(bookmark)
+ assigns[:sites] = [site]
+ render 'sites/index'
+ end
+
+ it "should have a bookmark button" do
+ response.should have_tag('a', %r[Bookmark something!])
+ end
+end

0 comments on commit 76ce826

Please sign in to comment.