Skip to content

Commit

Permalink
Added specs and implementation code for the parking controlers ticket…
Browse files Browse the repository at this point in the history
…s action.
  • Loading branch information
baphled committed May 14, 2010
1 parent 47f970a commit 85f7511
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/models/resource.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
class Resource < ActiveRecord::Base

def self.tickets(user_name, project_id, tag)
Lighthouse.account = user_name
Lighthouse::Ticket.find(:all, :params => { :project_id => project_id, :q => "state:open tagged:#{tag}" })
end
end
9 changes: 8 additions & 1 deletion spec/models/resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@
Resource.stub!(:name).and_return 'baphled'
Resource.name.should eql 'baphled'
end
it "should have a project name or id"
it "should have a project name or id" do
Resource.stub!(:project_id).and_return '50164'
Resource.project_id.should eql '50164'
end

it "should be able to make a call to lighthouse" do
Resource.tickets('baphled', '50164', 'feature').should_not be_empty
end
end

0 comments on commit 85f7511

Please sign in to comment.