Skip to content

Commit

Permalink
Merge pull request #61 from cmeiklejohn/add_branch_build_test_coverage
Browse files Browse the repository at this point in the history
Branch build by POST coverage
  • Loading branch information
queso committed Jun 22, 2011
2 parents 90f8062 + cc70c51 commit fa120fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions cijoe.gemspec
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/helper.rb
@@ -1,5 +1,6 @@
require 'rubygems'
require 'test/unit'
require 'mocha'

ENV['RACK_ENV'] = 'test'

Expand Down
7 changes: 7 additions & 0 deletions test/test_cijoe_server.rb
Expand Up @@ -82,6 +82,13 @@ def test_post_does_not_build_on_branch_mismatch
assert_equal 302, last_response.status
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
end

def test_post_does_build_on_branch_match
post "/", :payload => {"ref" => "refs/heads/master"}.to_json
assert app.joe.building?
Expand Down

0 comments on commit fa120fc

Please sign in to comment.