summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo k <mo@mokhan.ca>2012-03-04 12:42:12 -0700
committermo k <mo@mokhan.ca>2012-03-04 12:42:12 -0700
commit343d63f2c9862fe66dff7bff1e04e344e4a7814e (patch)
tree85a41b0c1b8781110cafb8dad715df74f57fe9e0
parentbe9327eea5ecd4e9387d124e2f4bd13b703b40ac (diff)
fix the timesheet controller unit tests
-rw-r--r--spec/unit/controllers/timesheet.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/unit/controllers/timesheet.rb b/spec/unit/controllers/timesheet.rb
index 3189069..82ba6c9 100644
--- a/spec/unit/controllers/timesheet.rb
+++ b/spec/unit/controllers/timesheet.rb
@@ -1,13 +1,14 @@
require 'developwithpassion_fakes'
class TimesheetController
- def initialize(blah)
-
+ def initialize(repository)
+ @repository = repository
end
def index
- []
+ @repository.find_all Timesheet
end
-
+end
+class Timesheet
end
describe TimesheetController do
before do
@@ -16,15 +17,14 @@ describe TimesheetController do
end
describe "when loading all timesheets" do
it "should return all the timesheets" do
- @results.should[0].equal(@timesheet)
+ @results[0].must_equal(@timesheet)
end
before do
timesheets = []
@timesheet = fake
timesheets << @timesheet
- @repository.stub(:find_all).ignore_arg.and_return(timesheets)
+ @repository.stub(:find_all).with(Timesheet).and_return(timesheets)
@results = @sut.index
end
end
-
end