Skip to content

Instantly share code, notes, and snippets.

@xirukitepe
Created November 7, 2012 08:10
Show Gist options
  • Save xirukitepe/4030135 to your computer and use it in GitHub Desktop.
Save xirukitepe/4030135 to your computer and use it in GitHub Desktop.
Helper spec example
describe EventsHelper do
describe "#link_to_event" do
it "displays the title, and formatted date" do
event = Event.new("Ruby Kaigi", Date.new(2010, 8, 27))
# helper is an instance of ActionView::Base configured with the
# EventsHelper and all of Rails' built-in helpers
helper.link_to_event.should =~ /Ruby Kaigi, 27 Aug, 2010/
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment