spec/issue_spec.rb in jiralicious-0.0.6 vs spec/issue_spec.rb in jiralicious-0.1.0

- old
+ new

@@ -1,15 +1,16 @@ # encoding: utf-8 -require File.expand_path(File.dirname(__FILE__) + '/spec_helper') +require "spec_helper" describe Jiralicious::Issue, "finding" do before :each do Jiralicious.configure do |config| config.username = "jstewart" config.password = "topsecret" config.uri = "http://localhost" + config.auth_type = :cookie config.api_version = "latest" end FakeWeb.register_uri(:get, "#{Jiralicious.rest_path}/issue/EX-1", @@ -24,10 +25,11 @@ it "raises an exception when the issue can't be found or can't be viewed" do lambda { FakeWeb.register_uri(:get, "#{Jiralicious.rest_path}/issue/EX-1", + :body => "{errorMessages: ['error']}", :status => ["404" "Not Found"]) Jiralicious::Issue.find("EX-1") }.should raise_error(Jiralicious::IssueNotFound) end @@ -67,11 +69,11 @@ :status => "204", :body => nil) result = Jiralicious::Issue.transition("#{Jiralicious.rest_path}/issue/EX-1/transitions", {"transition" => "3", "fields" => []}) - result.should be_empty + result.should be_nil end it "raises an exception on transition failure" do FakeWeb.register_uri(:post, "#{Jiralicious.rest_path}/issue/EX-1/transitions", @@ -91,6 +93,6 @@ lambda { result = Jiralicious::Issue.transition("#{Jiralicious.rest_path}/issue/EX-1/transitions", {"transition" => "invalid"}) }.should raise_error(Jiralicious::IssueNotFound) end -end \ No newline at end of file +end