Skip to content

Instantly share code, notes, and snippets.

@ilstar
Created March 29, 2011 07:16
Show Gist options
  • Select an option

  • Save ilstar/891932 to your computer and use it in GitHub Desktop.

Select an option

Save ilstar/891932 to your computer and use it in GitHub Desktop.
Rspec View Test
require 'spec_helper'
# the string is your real path of view file.
describe "home/index" do
before do
login_as @user
template.stub('smart_link_to').and_return('')
@user = Factory(:user)
end
it "should not display renren form" do
template.should_receive('display?').and_return(false)
render
response.should_not have_tag('div[id=?]', 'user_id')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment