Skip to content

Commit

Permalink
Refactored spec and implemented first spec, will implement the rest l…
Browse files Browse the repository at this point in the history
…ater.
  • Loading branch information
baphled committed May 13, 2010
1 parent 97a4c22 commit 6e32755
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
9 changes: 9 additions & 0 deletions app/controllers/parking_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# To change this template, choose Tools | Templates
# and open the template in the editor.

class ParkingController < ActionController::Base
layout "application"
def tickets
@tickets = Lighthouse::Ticket.find(:all, :params => { :project_id => '50164', :q => "state:open tagged:#{params[:tag]}" })
end
end
19 changes: 5 additions & 14 deletions spec/controllers/parking_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

class ParkingController < ActionController::Base
end

describe ParkingController do
describe "GET, index" do
describe "GET, tickets" do
context "requesting a list of tickets" do
it "should be able to retrieve all tickets with a given tag"
end

context "a successful search has been requested" do
it "should display a list of open tickets"
end

context "no tickets where found" do
it "should return an empty list"
it "should display a flash message"
it "should do a search using the LightHouse API for tags" do
Lighthouse::Ticket.should_receive(:find).with(:all, :params => { :project_id => '50164', :q => "state:open tagged:feature" })
get :tickets, {:tag => 'feature'}
end
end
end
end

0 comments on commit 6e32755

Please sign in to comment.