Skip to content

Commit

Permalink
Use Likeno::Entity#all implementation on Projects
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoamc committed Mar 28, 2016
1 parent 42bba5a commit 9558cac
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
4 changes: 0 additions & 4 deletions lib/kalibro_client/entities/processor/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ def id=(value)
@id = value.to_i
end

def self.all
create_objects_array_from_hash(request('', {}, :get))
end

def repositories
Repository.create_objects_array_from_hash(self.class.request(':id/repositories', {id: id}, :get))
end
Expand Down
34 changes: 0 additions & 34 deletions spec/entities/processor/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,40 +31,6 @@
end
end

describe 'all' do
context 'with no projects' do
before :each do
KalibroClient::Entities::Processor::Project.
expects(:request).
with('', {}, :get).
returns({"projects" => []})
end

it 'should return nil' do
expect(KalibroClient::Entities::Processor::Project.all).to be_empty
end
end

context 'with many projects' do
let(:project) { FactoryGirl.build(:project) }
let(:another_project) { FactoryGirl.build(:another_project) }

before :each do
KalibroClient::Entities::Processor::Project.
expects(:request).
with('', {}, :get).
returns({"projects" => [project.to_hash, another_project.to_hash]})
end

it 'should return a list with projects' do
projects = KalibroClient::Entities::Processor::Project.all

expect(projects.first.name).to eq(project.name)
expect(projects.last.name).to eq(another_project.name)
end
end
end

describe 'repositories' do
let(:project) { FactoryGirl.build(:project) }
let(:repository) { FactoryGirl.build(:repository) }
Expand Down

0 comments on commit 9558cac

Please sign in to comment.