Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add basic post specs

  • Loading branch information...
commit 634cf41ef5b62574122436a60626466c25f817e5 1 parent 700ddcb
@sarahmei sarahmei authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 spec/diff_mailer_spec.rb
View
15 spec/diff_mailer_spec.rb
@@ -16,4 +16,19 @@ def app
last_response.should be_ok
last_response.body.should =~ /Yup\./
end
+
+ describe "when github posts a commit" do
+ describe "when commit is on master" do
+ it "sends email" do
+ Pony.should_receive(:mail)
+ post '/commit', 'payload' => {"ref" => "refs/heads/master", "commits" => []}.to_json
+ end
+ end
+ describe "when commit is not on master" do
+ it "does not send email" do
+ Pony.should_not_receive(:mail)
+ post '/commit', 'payload' => {"ref" => "not/master"}.to_json
+ end
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.