Skip to content

Instantly share code, notes, and snippets.

@urfolomeus
Created July 20, 2011 11:00
Show Gist options
  • Save urfolomeus/1094759 to your computer and use it in GitHub Desktop.
Save urfolomeus/1094759 to your computer and use it in GitHub Desktop.
Example of using Capybara with RSpec to check the class and content of a table cell
require 'spec_helper'
describe "daemons/index.html.erb", :type => :request do
before :each do
assign( :daemons, { 'test' => :up } )
render
end
it "has the correct class" do
rendered.should have_css('table tr td.daemon-up')
end
it "has the correct content" do
rendered.should have_content('Up')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment