Skip to content

Instantly share code, notes, and snippets.

@thoughtbot
Created August 4, 2009 22:27
Show Gist options
  • Save thoughtbot/162320 to your computer and use it in GitHub Desktop.
Save thoughtbot/162320 to your computer and use it in GitHub Desktop.
class ArticleTest < ActiveSupport::TestCase
should_validate_presence_of :title, :abstract, :body, :author
should "submit to crossref after being saved" do
title = 'a title'
request = mock('crossref-request', :submit => true)
CrossrefRequest.
expects(:new).
with(:title => title, ...).
returns(request)
Factory(:article, :title => title, ...)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment