Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module BugherdAPI | ||
class Project < Base | ||
end | ||
end |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |