Skip to content
This repository has been archived by the owner on Sep 7, 2018. It is now read-only.

Commit

Permalink
renamed zendesk-api.rb file to zendesk_api.rb. fixes bug with bundler…
Browse files Browse the repository at this point in the history
… replacing dashes with slashes for files names
  • Loading branch information
jordanandree committed Oct 11, 2012
1 parent 86e03e8 commit 5bb1b9e
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Manifest
Expand Up @@ -3,7 +3,7 @@ README.markdown
Rakefile
geminstaller.yml
lib/console.rb
lib/zendesk-api.rb
lib/zendesk_api.rb
lib/zendesk.rb
lib/zendesk/attachment.rb
lib/zendesk/entry.rb
Expand Down
2 changes: 1 addition & 1 deletion lib/console.rb
@@ -1,4 +1,4 @@
require 'lib/zendesk-api'
require 'lib/zendesk_api'
puts <<-TXT
Stuff here to explain what it does
TXT
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions spec/zendesk/main_spec.rb
@@ -1,5 +1,5 @@
require "spec"
require 'zendesk-api'
require 'zendesk_api'

describe Zendesk::Main do
describe "basic" do
Expand Down Expand Up @@ -106,18 +106,18 @@
describe "#self.to_xml" do
context "comments" do
it "should output correctly formatted XML" do
input = {"value" => "new comment", "public" => true}
input = {"public" => true,"value" => "new comment"}
xml = Zendesk::Main.to_xml('comment', input)
xml.should =~ /<comment>\s*<public type=\"boolean\">true<\/public>\s*<value>new comment<\/value>\s*<\/comment>/
end
end

context "tickets" do
it "should output correctly formatted XML" do
input = {"subject" => "rspec rulez", "description" => "description", "status_id"=>1}
input = {"subject" => "rspec rulez","status_id"=>1,"description" => "description"}
xml = Zendesk::Main.to_xml('ticket', input)
xml.should =~ /<ticket>\s*<subject>rspec rulez<\/subject>\s*<status-id type=\"integer\">1<\/status-id>\s*<description>description<\/description>\s*<\/ticket>/
end
end
end
end
end
26 changes: 13 additions & 13 deletions spec/zendesk/user_spec.rb
@@ -1,5 +1,5 @@
require "spec"
require 'zendesk-api'
require 'zendesk_api'

describe Zendesk::Main, 'user api' do
# before do
Expand Down Expand Up @@ -34,40 +34,40 @@
body=Zendesk::Main.to_xml('user', data)
curl.should_receive(:http_post).with(body)
curl.stub!(:header_str) { "\r\ntest: blah"}
curl.stub!(:response_code).and_return(200)
curl.stub!(:response_code).and_return(200)
curl
end
end
zendesk = Zendesk::Main.new('my_company', "some_login", "some_password")
response = zendesk.update_user(39,data)
response.curl.headers["X-Http-Method-Override"].should == "put"
response.url.should =~ %r{/users/39.xml$}
response.status.should == 200
end
it "should be able to get" do

it "should be able to get" do
curl_object = Curl::Easy.method(:new)
Curl::Easy.stub!(:new).and_return do |*args|
curl = curl_object.call(*args)
curl.stub!(:perform)
curl.stub!(:header_str) { "\r\ntest: blah"}
curl.stub!(:response_code).and_return(200)
curl.stub!(:response_code).and_return(200)
curl
end
end
zendesk = Zendesk::Main.new('my_company', "some_login", "some_password")
response = zendesk.get_user(13)
response.url.should =~ %r{/users/13.xml$}
response.status.should == 200
end

it "should be able to list all" do
curl_object = Curl::Easy.method(:new)
Curl::Easy.stub!(:new).and_return do |*args|
curl = curl_object.call(*args)
curl.stub!(:perform)
curl.stub!(:header_str) { "\r\ntest: blah"}
curl.stub!(:response_code).and_return(200)
curl.stub!(:response_code).and_return(200)
curl
end
end
zendesk = Zendesk::Main.new('my_company', "some_login", "some_password")
response = zendesk.get_users
response.url.should =~ %r{/users.xml$}
Expand All @@ -80,13 +80,13 @@
curl = curl_object.call(*args)
curl.stub!(:http_delete)
curl.stub!(:perform)
curl.stub!(:response_code).and_return(200)
curl.stub!(:response_code).and_return(200)
curl.stub!(:header_str) { "\r\nadsf\r\ndsaf"}
curl
end
end
zendesk = Zendesk::Main.new('my_company', "some_login", "some_password")
response = zendesk.delete_user(12)
response.url.should =~ %r{/users/12.xml}
response.status.should == 200
end
end
end
4 changes: 2 additions & 2 deletions zendesk-api.gemspec
Expand Up @@ -9,8 +9,8 @@ Gem::Specification.new do |s|
s.date = %q{2010-12-27}
s.description = %q{RubyGem wrapper for REST API to http://zendesk.com}
s.email = %q{pg.ericson@gmail.com}
s.extra_rdoc_files = ["README.markdown", "lib/console.rb", "lib/zendesk-api.rb", "lib/zendesk.rb", "lib/zendesk/attachment.rb", "lib/zendesk/comment.rb", "lib/zendesk/entry.rb", "lib/zendesk/forum.rb", "lib/zendesk/group.rb", "lib/zendesk/main.rb", "lib/zendesk/organization.rb", "lib/zendesk/search.rb", "lib/zendesk/tag.rb", "lib/zendesk/ticket.rb", "lib/zendesk/user.rb", "lib/zendesk/user_identity.rb"]
s.files = ["Manifest", "README.markdown", "Rakefile", "geminstaller.yml", "lib/console.rb", "lib/zendesk-api.rb", "lib/zendesk.rb", "lib/zendesk/attachment.rb", "lib/zendesk/comment.rb", "lib/zendesk/entry.rb", "lib/zendesk/forum.rb", "lib/zendesk/group.rb", "lib/zendesk/main.rb", "lib/zendesk/organization.rb", "lib/zendesk/search.rb", "lib/zendesk/tag.rb", "lib/zendesk/ticket.rb", "lib/zendesk/user.rb", "lib/zendesk/user_identity.rb", "spec/zendesk/main_spec.rb", "spec/zendesk/user_spec.rb", "zendesk-api.gemspec"]
s.extra_rdoc_files = ["README.markdown", "lib/console.rb", "lib/zendesk_api.rb", "lib/zendesk.rb", "lib/zendesk/attachment.rb", "lib/zendesk/comment.rb", "lib/zendesk/entry.rb", "lib/zendesk/forum.rb", "lib/zendesk/group.rb", "lib/zendesk/main.rb", "lib/zendesk/organization.rb", "lib/zendesk/search.rb", "lib/zendesk/tag.rb", "lib/zendesk/ticket.rb", "lib/zendesk/user.rb", "lib/zendesk/user_identity.rb"]
s.files = ["Manifest", "README.markdown", "Rakefile", "geminstaller.yml", "lib/console.rb", "lib/zendesk_api.rb", "lib/zendesk.rb", "lib/zendesk/attachment.rb", "lib/zendesk/comment.rb", "lib/zendesk/entry.rb", "lib/zendesk/forum.rb", "lib/zendesk/group.rb", "lib/zendesk/main.rb", "lib/zendesk/organization.rb", "lib/zendesk/search.rb", "lib/zendesk/tag.rb", "lib/zendesk/ticket.rb", "lib/zendesk/user.rb", "lib/zendesk/user_identity.rb", "spec/zendesk/main_spec.rb", "spec/zendesk/user_spec.rb", "zendesk-api.gemspec"]
s.homepage = %q{http://github.com/pgericson/zendesk-api}
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Zendesk-api", "--main", "README.markdown"]
s.require_paths = ["lib"]
Expand Down

1 comment on commit 5bb1b9e

@joshgoebel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can a new gem please be pushed so I don't have to pull this gem from github?

Please sign in to comment.