Skip to content

Commit

Permalink
Merge branch 'managing-projects'
Browse files Browse the repository at this point in the history
  • Loading branch information
cored committed Aug 23, 2011
2 parents da9db52 + b024cf3 commit d2ebc31
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/bugherd.rb
Expand Up @@ -7,8 +7,9 @@
module BugherdAPI
extend ActiveSupport::Autoload

autoload :Base, 'bugherd/base'
autoload :User, 'bugherd/user'
autoload :Base, 'bugherd/base'
autoload :User, 'bugherd/user'
autoload :Project, 'bugherd/project'
class Error < StandardError; end

class << self
Expand Down
Binary file added lib/bugherd/.project.rb.swp
Binary file not shown.
4 changes: 4 additions & 0 deletions lib/bugherd/project.rb
@@ -0,0 +1,4 @@
module BugherdAPI
class Project < Base
end
end
Binary file added spec/.project_spec.rb.swp
Binary file not shown.
Binary file added spec/fixtures/.projects.xml.swp
Binary file not shown.
13 changes: 13 additions & 0 deletions spec/fixtures/projects.xml
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<projects type="array">
<project>
<id type="integer">1458</id>
<name>clutchapptest</name>
<devurl>http://clutchapptest.ticketmaster.com</devurl>
</project>
<project>
<id type="integer">1487</id>
<name>testing</name>
<devurl>yeah.com</devurl>
</project>
</projects>
Binary file added spec/fixtures/projects/.1458.xml.swp
Binary file not shown.
14 changes: 14 additions & 0 deletions spec/fixtures/projects/1458.xml
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<id type="integer">1458</id>
<name>clutchapptest</name>
<devurl>http://clutchapptest.ticketmaster.com</devurl>
<users type="array">
<user>
<id type="integer">1798</id>
<email>george.rafael@gmail.com</email>
<name>Rafael</name>
<surname>George</surname>
</user>
</users>
</project>
35 changes: 35 additions & 0 deletions spec/project_spec.rb
@@ -0,0 +1,35 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "BugherdAPI::Project" do
before(:each) do
BugherdAPI.authenticate('user@email.com', '123456')
ActiveResource::HttpMock.respond_to do |mock|
mock.get '/api_v1/projects.xml', {}, fixture_for('projects', 'xml'), 200
mock.get '/api_v1/projects/1458.xml', {}, fixture_for('projects/1458','xml'), 200
end
end

context "Project retrieval" do
it "should load all projects" do
projects = BugherdAPI::Project.find(:all)
projects.should_not be_nil
end

it "shoulod load a single project" do
project = BugherdAPI::Project.find(1458)
project.should_not be_nil
end

it "should check for projects fields" do
project = BugherdAPI::Project.find(1458)
project.name.should == 'clutchapptest'
project.devurl.should == 'http://clutchapptest.ticketmaster.com'
end
end

context "Project creation, update and delete" do
it "should create a project"
it "should update a project"
it "should delete a project"
end
end

0 comments on commit d2ebc31

Please sign in to comment.