Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add mocha and test to ensure that a post with a branch name really

builds that branch.
  • Loading branch information...
commit cc70c51e4a0cb1f836114a9d97fd63dc8b21ec47 1 parent 519666c
@cmeiklejohn cmeiklejohn authored
Showing with 3 additions and 0 deletions.
  1. +1 −0  cijoe.gemspec
  2. +1 −0  test/helper.rb
  3. +1 −0  test/test_cijoe_server.rb
View
1  cijoe.gemspec
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'json'
s.add_runtime_dependency 'tinder', '>= 1.4.0'
s.add_development_dependency 'rack-test'
+ s.add_development_dependency 'mocha'
s.description = <<desc
cijoe is a sinatra-based continuous integration server. It's like an
View
1  test/helper.rb
@@ -1,5 +1,6 @@
require 'rubygems'
require 'test/unit'
+require 'mocha'
ENV['RACK_ENV'] = 'test'
View
1  test/test_cijoe_server.rb
@@ -83,6 +83,7 @@ def test_post_does_not_build_on_branch_mismatch
end
def test_post_builds_specific_branch
+ app.joe.expects(:build!).with("branchname")
post "/?branch=branchname", :payload => {"ref" => "refs/heads/master"}.to_json
assert app.joe.building?
assert_equal 302, last_response.status
Please sign in to comment.
Something went wrong with that request. Please try again.